Muutke küpsiste eelistusi

Beginner's Guide to Scala, Object Orientation and Functional Programming 2014 ed. [Pehme köide]

  • Formaat: Paperback / softback, 494 pages, kõrgus x laius: 235x155 mm, kaal: 777 g, 11 Tables, black and white; 790 Illustrations, black and white; XVIII, 494 p. 790 illus., 1 Paperback / softback
  • Ilmumisaeg: 28-Jul-2014
  • Kirjastus: Springer International Publishing AG
  • ISBN-10: 3319067753
  • ISBN-13: 9783319067759
  • Pehme köide
  • Hind: 61,10 €*
  • * saadame teile pakkumise kasutatud raamatule, mille hind võib erineda kodulehel olevast hinnast
  • See raamat on trükist otsas, kuid me saadame teile pakkumise kasutatud raamatule.
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Lisa soovinimekirja
  • Formaat: Paperback / softback, 494 pages, kõrgus x laius: 235x155 mm, kaal: 777 g, 11 Tables, black and white; 790 Illustrations, black and white; XVIII, 494 p. 790 illus., 1 Paperback / softback
  • Ilmumisaeg: 28-Jul-2014
  • Kirjastus: Springer International Publishing AG
  • ISBN-10: 3319067753
  • ISBN-13: 9783319067759
Scala is a new programming language developed by Martin Odersky and his team at the EPFL. The name Scala is derived from Sca(lable) La(nguage). Scala is a multi-paradigm language, incorporating object oriented approaches with functional programming. Although some familiarity with standard computing concepts is assumed (such as the idea of compiling a program and executing this compiled form, etc.) and with basic procedural language concepts (such as variables and allocation of values to variables) the early chapters of the book do not assume any familiarity with object orientation nor functional programming. These chapters also step through other concepts with which the reader may not be familiar (such as list processing). From this background, John Hunt provides a practical introduction to object and functional technology using Scala, one of the newest and most interesting programming languages available. A variety of concepts are introduced through practical experience taking th

e reader beyond the level of the language syntax to the philosophy and practice of object-oriented development and functional programming. Students, and those actively involved in the software industry will find this comprehensive introduction to Scala and to object orientation and functional programming, invaluable.

Introduction.- Elements of Object Orientation.- Why Object Orientation .- Constructing an Object Oriented System.- Functional Programming.- Scala Background.- A Little Scala.- Scala Building Blocks.- Scala Classes.- Scala Methods.- Building a Class.- Packages and Encapsulation.- Classes, Inheritance and Abstraction.- Objects and Instances.- Value Classes.- Scala Constructs.- Control and Iteration.- Traits.- Further Traits.- Arrays.- Tuples.- Functional Programming in Scala.- Higher Order Functions.- Partially Applied Functions and Currying.- Scala Collections Framework.- Immutable Lists and Maps.- Immutable and Mutable Collection Packages.- Type Parameterization.- Further Language Constructs.- Exception Handling.- Scala and JDBC Database Access.- Scala Style Database Access.- Scala and MySQL Database Example.- Testing.- Scala Testing.- Introduction to Akka Actors.- Further Akka Actors.- Play Framework.- Restful Services.- Scala Swing.- User Input in Scala Swing.- Scala Build Tools

.- Scala and Java Interoperability.

Arvustused

From the book reviews:

It is a guide to a new programming language, Scala, that is written to serve the needs of advanced students or skilled software developers who wish to learn to use Scala to its fullest extent. presents Scala in a stepwise manner in 43 well-focused and well-organized chapters. The chapters contain numerous code examples, encouraging readers to play with the examples and learn by experiencing the language. Summing Up: Recommended. Upper-division undergraduates through professionals/practitioners; two-year technical program students. (J. Beidler, Choice, Vol. 52 (7), March, 2015)

1 Introduction 1(6)
1.1 Introduction
1(1)
1.2 What is Scala?
1(1)
1.3 Why Scala?
2(1)
1.4 Java to Scala Quick Comparison
3(1)
1.5 Is This Book for You?
4(1)
1.6 Approach Taken by This Book
5(1)
Further Reading
5(2)
2 Elements of Object Orientation 7(8)
2.1 Introduction
7(1)
2.2 Terminology
7(2)
2.3 Types of Hierarchy
9(2)
2.4 The Move to Object Technology
11(1)
2.5 Summary
12(1)
2.6 Exercises
13(1)
Further Reading
13(2)
3 Why Object Orientation? 15(6)
3.1 Introduction
15(1)
3.2 The Procedural Approach
15(2)
3.2.1 A Naked Data Structure
15(1)
3.2.2 Procedures for the Data Structure
16(1)
3.2.3 Packages
17(1)
3.3 Does Object Orientation Do Better?
17(3)
3.3.1 Packages Versus Classes
17(2)
3.3.2 Inheritance
19(1)
3.4 Summary
20(1)
4 Constructing an Object Oriented System 21(12)
4.1 Introduction
21(1)
4.2 The Application: Windscreen Wipe Simulation
21(1)
4.3 Where Do We Start?
22(1)
4.4 Identifying the Objects
23(1)
4.5 Identifying the Services or Methods
24(1)
4.6 Refining the Objects
25(1)
4.7 Bringing It All Together
26(3)
4.8 Where Is the Structure?
29(2)
4.9 Summary
31(1)
4.10 Exercises
32(1)
4.11 Further Reading
32(1)
References
32(1)
5 Functional Programming 33(6)
5.1 Introduction
33(1)
5.2 What is Functional Programming?
33(2)
5.3 Advantages to Functional Programming
35(1)
5.4 Disadvantages of Functional Programming
36(1)
5.5 Scala and Functional Programming
37(2)
6 Scala Background 39(4)
6.1 Introduction
39(1)
6.2 The Class Person
39(2)
6.3 Functional Programming
41(1)
6.4 A Hybrid Language
42(1)
7 A Little Scala 43(16)
7.1 Introduction
43(1)
7.2 The Scala Environment
43(1)
7.3 The Scala Shell
44(1)
7.4 The Scala IDE
45(6)
7.4.1 Selecting a Workspace
45(2)
7.4.2 Inside Eclipse
47(1)
7.4.3 Creating a Project
47(2)
7.4.4 Scala IDE and REPL
49(2)
7.5 Implementing the Object
51(1)
7.6 Running the Application
52(1)
7.7 Scala Classpath
52(1)
7.8 Compiling and Executing Scala
53(2)
7.9 Memory Management
55(2)
7.9.1 Why Have Automatic Memory Management?
55(1)
7.9.2 Memory Management in Scala
56(1)
7.9.3 When Is Garbage Collection Performed?
56(1)
7.9.4 Checking the Available Memory
56(1)
7.10 Scala on .Net
57(1)
References
58(1)
Further Reading
58(1)
8 Scala Building Blocks 59(4)
8.1 Introduction
59(1)
8.2 Apps and Applications
59(1)
8.3 The Basics of the Language
60(3)
8.3.1 Some Terminology
61(1)
8.3.2 The Message Passing Mechanism
62(1)
8.3.3 The Statement Terminator
62(1)
9 Scala Classes 63(16)
9.1 Introduction
63(1)
9.2 Classes
63(13)
9.2.1 Class Definitions
63(1)
9.2.2 Developing a Class Definition
64(2)
9.2.3 Classes and Messages
66(1)
9.2.4 Instances and Instance Variables
66(1)
9.2.5 Classes and Inheritance
67(2)
9.2.6 Instance Creation
69(2)
9.2.7 Constructors
71(2)
9.2.8 Auxiliary Constructors
73(1)
9.2.9 Class Initialisation Behaviour
74(1)
9.2.10 Review of classes and constructors
75(1)
9.3 Case Classes
76(3)
9.3.1 A Sample Class
77(2)
10 Scala Methods 79(14)
10.1 Introduction
79(1)
10.2 Method Definitions
79(11)
10.2.1 Method Parameters
81(1)
10.2.2 Comments
82(1)
10.2.3 The Local Variables Section
83(1)
10.2.4 The Statements Section
83(2)
10.2.5 The Return Operator
85(1)
10.2.6 An Example Method
85(1)
10.2.7 Overriding toString
86(2)
10.2.8 Defining Property Methods
88(2)
10.3 Named Parameters
90(3)
11 Building a Class 93(12)
11.1 Introduction
93(1)
11.2 Create a New Project
93(1)
11.3 Create a New Package
93(3)
11.4 Create a New Class
96(1)
11.5 Defining the Class
96(2)
11.6 Adding Behaviour
98(1)
11.7 Test Application
99(2)
11.8 Override toString
101(2)
11.9 Extras
103(2)
12 Packages & Encapsulation 105(18)
12.1 Introduction
105(1)
12.2 Packages
105(9)
12.2.1 Declaring a Package
106(1)
12.2.2 Additional Package Definitions Options
106(5)
12.2.3 An Example Package
111(1)
12.2.4 Accessing Package Elements
112(1)
12.2.5 An Example of Using a Package
113(1)
12.3 Import Options
114(1)
12.4 Additional Import Features
115(1)
12.5 Package Objects
116(1)
12.6 Key Scala Packages
117(1)
12.7 Default Imports
118(1)
12.8 Encapsulation
118(5)
12.8.1 Scala Visibility Modifiers
118(1)
12.8.2 Private Modified
119(1)
12.8.3 Protected Modifier
120(3)
13 Classes, Inheritance and Abstraction 123(16)
13.1 Introduction
123(1)
13.1.1 What Are Classes For?
123(1)
13.2 Inheritance Between Types
124(1)
13.3 Inheritance Between Classes
125(5)
13.3.1 The Role of a Subclass
126(1)
13.3.2 Capabilities of Classes
127(1)
13.3.3 Overriding Behaviour
128(1)
13.3.4 Protected Members
129(1)
13.4 Restricting a Subclass
130(2)
13.5 Abstract Classes
132(2)
13.6 The Super Keyword
134(1)
13.7 Scala Type Hierarchy
135(1)
13.8 Polymorphism
136(3)
14 Objects and Instances 139(8)
14.1 Introduction
139(1)
14.2 Singleton Objects
139(2)
14.3 Companion Objects
141(4)
14.3.1 Companion Object Behaviour
143(1)
14.3.2 A Object or an Instance
144(1)
Further Reading
145(2)
15 Value Classes 147(4)
15.1 Introduction
147(1)
15.2 Value Classes
147(1)
15.3 Simple Value Type Example
148(1)
15.4 Additional Value Class Concepts
149(1)
15.5 Negating Value Classes
150(1)
16 Scala Constructs 151(12)
16.1 Introduction
151(1)
16.2 Numbers and Numeric Operators
151(2)
16.2.1 Numeric Values
151(1)
16.2.2 Arithmetic Operators
152(1)
16.3 Characters and Strings
153(1)
16.3.1 Characters
153(1)
16.3.2 Strings
153(1)
16.4 Assignments
154(1)
16.5 Variables
155(4)
16.5.1 Temporary Variables
155(1)
16.5.2 Pseudo Variables
156(1)
16.5.3 Variable Scope
157(1)
16.5.4 Option, Some and None
157(2)
16.5.5 Boolean Values
159(1)
16.5.6 Literals
159(1)
16.6 Messages and Message Selectors
159(2)
16.6.1 Invoking Methods
159(1)
16.6.2 Precedence
160(1)
16.7 Summary
161(2)
17 Control and Iteration 163(16)
17.1 Introduction
163(1)
17.2 Control Structures
163(2)
17.2.1 The if Statement
163(2)
17.2.2 If Returns a Value
165(1)
17.3 Iteration
165(6)
17.3.1 For Loops
165(2)
17.3.2 For Until
167(1)
17.3.3 For Loop with a Filter
167(1)
17.3.4 Long Hand for Loop
168(1)
17.3.5 For-Yield Loop
168(1)
17.3.6 While Loops
169(1)
17.3.7 Do Loops
170(1)
17.3.8 An Example of Loops
171(1)
17.4 Equality
171(1)
17.5 Recursion
172(7)
17.5.1 The Match Expression
174(5)
18 Traits 179(12)
18.1 Introduction
179(1)
18.2 What are Traits?
179(1)
18.3 Defming a Trait
180(2)
18.4 Using a Trait
182(2)
18.5 Abstract Trait Members
184(1)
18.6 Dynamic Binding of Traits
184(2)
18.7 Sealed Traits
186(1)
18.8 Marker Traits
186(1)
18.9 Trait Dependencies
187(2)
18.10 To Trait or not to Trait
189(2)
19 Further Traits 191(10)
19.1 Introduction
191(1)
19.2 Stackable Modifications
191(5)
19.3 Fat versus Thin Interfaces
196(1)
19.4 Universal Traits
197(2)
19.5 Traits for a Data Type
199(2)
20 Arrays 201(10)
20.1 Introduction
201(1)
20.2 Arrays
201(5)
20.2.1 Arrays of Objects
203(1)
20.2.2 Ragged Arrays
204(2)
20.3 Creating Square Arrays
206(2)
20.4 Looping Through Arrays
208(1)
20.5 The Main Method Revisted
209(2)
21 Tuples 211(6)
21.1 Introduction
211(1)
21.2 Tuples
211(1)
21.3 Tuple Characteristics
212(1)
21.4 Tuple Classes
212(1)
21.5 Creating a Tuple
212(1)
21.6 Working with Tuples
213(1)
21.7 Iterating over a Tuple
214(1)
21.8 Element Extraction
215(2)
22 Functional Programming in Scala 217(10)
22.1 Introduction
217(1)
22.2 Scala as a Functional Language
217(1)
22.3 Defining Scala Functions
218(3)
22.4 Class, Objects and Methods
221(2)
22.5 Closure
223(4)
23 Higher Order Functions 227(6)
23.1 Introduction
227(1)
23.2 Higher Order Function Concepts
227(1)
23.3 Scala Higher Order Functions
228(2)
23.4 Using Higher Order Functions
230(1)
23.5 Higher-Order Functions in Scala Collections
231(2)
24 Partially Applied Functions and Currying 233(8)
24.1 Introduction
233(1)
24.2 Partially Applied Functions
234(1)
24.3 Currying
235(6)
24.3.1 Introduction to Currying
235(1)
24.3.2 Defining Multiple Parameter List Functions
236(1)
24.3.3 Using Curried Functions
237(1)
24.3.4 Building Domain Specific Languages
238(3)
25 Scala Collections Framework 241(6)
25.1 Introduction
241(1)
25.2 What are Collections?
241(1)
25.3 Scala Collections
242(5)
25.3.1 Package Scala.Collection
243(1)
25.3.2 Common Seq Behaviour
244(1)
25.3.3 Common Set Behaviour
245(1)
25.3.4 Common Map Behaviour
246(1)
26 Immutable Lists and Maps 247(14)
26.1 Introduction
247(1)
26.2 The Immutable List Collection
247(10)
26.2.1 List Creation
247(1)
26.2.2 List Concatenation
248(1)
26.2.3 List Operations
249(2)
26.2.4 List Processing
251(1)
26.2.5 Further List Processing
251(3)
26.2.6 Pattern Matching
254(1)
26.2.7 Converting to a List
255(1)
26.2.8 Lists of User Defined Types
255(2)
26.3 The Immutable Map Type
257(4)
27 Immutable and Mutable Collection Packages 261(10)
27.1 Introduction
261(1)
27.2 Package scala.collection.immutable
261(4)
27.2.1 Sequences
261(3)
27.2.2 Sets
264(1)
27.2.3 Maps
265(1)
27.3 Package scala.collection.mutable
265(4)
27.3.1 ArrayBuffer
266(1)
27.3.2 ListBuffer
266(1)
27.3.3 LinkedList
267(1)
27.3.4 Stack
267(1)
27.3.5 HashMap
268(1)
27.4 Generic Collections
269(1)
27.5 Summary
270(1)
28 Type Parameterization 271(8)
28.1 Introduction
271(1)
28.2 The Set class
271(1)
28.3 Adding Type Parameterization
272(4)
28.3.1 The MyQueue Mutable Class
272(2)
28.3.2 The Queue Immutable Class
274(2)
28.4 Variance
276(1)
28.5 Lower and Upper Bounds
277(1)
28.6 Combining Variance and Bounds
278(1)
29 Further Language Constructs 279(18)
29.1 Introduction
279(1)
29.2 Implicit Conversions
279(2)
29.3 Implicit Parameters
281(2)
29.4 Implicit Objects
283(1)
29.5 Implicit Classes
284(2)
29.6 Scala Annotations
286(2)
29.7 Type Declarations
288(1)
29.8 Enumerations
289(5)
29.9 Lazy Evaluation
294(3)
30 Exception Handling 297(14)
30.1 Introduction
297(1)
30.2 What Is an Exception?
297(2)
30.3 What Is Exception Handling?
299(2)
30.4 Throwing an Exception
301(1)
30.5 Catching an Exception
301(4)
30.6 Try Block Returns a Value
305(1)
30.7 Defining an Exception
305(1)
30.8 A More Functional Approach
306(3)
30.9 The Try Type
309(2)
31 Scala and JDBC Database Access 311(24)
31.1 Introduction
311(1)
31.2 Why JDBC?
311(1)
31.3 What is JDBC?
312(2)
31.4 Working with JDBC
314(1)
31.5 The Database Driver
315(1)
31.6 Registering Drivers
316(1)
31.7 Opening a Connection
317(2)
31.8 Obtaining Data from a Database
319(1)
31.9 Inserting into a Table
320(3)
31.10 Update an existing Row
323(1)
31.11 Deleting from a Table
323(1)
31.12 Creating a Table
324(2)
31.13 Stored Procedures
326(1)
31.14 JDBC Data Sources
326(2)
31.15 Connection Pooling
328(3)
31.16 JDBC MetaData
331(4)
31.16.1 DatabaseMetaData
331(1)
31.16.2 ResultSetMetaData
332(3)
32 Scala Style Database Access 335(6)
32.1 Introduction
335(1)
32.2 SLICK
335(1)
32.3 Querulus
336(1)
32.4 Squeryl
337(1)
32.5 O/R Broker
338(1)
Further Reading
339(2)
33 Scala and MySQL Database Example 341(18)
33.1 Introduction
341(1)
33.2 Obtaining MySQL
341(1)
33.2.1 Starting/Stopping/Connecting to MySQL
341(1)
33.3 Creating a Database
342(3)
33.3.1 Adding a User
343(1)
33.3.2 Selecting to Work with a Database
343(1)
33.3.3 Creating a Table
344(1)
33.3.4 Adding Data to a Table
345(1)
33.4 Creating the Scala Project
345(1)
33.5 Create a New Package
345(1)
33.6 Obtaining the JDBC Libraries
346(1)
33.7 Modifying the Project Properties
347(2)
33.8 Accessing the Database
349(8)
33.9 Running the Application
357(2)
34 Testing 359(6)
34.1 Introduction
359(1)
34.2 Types of Testing
359(1)
34.3 What should be Tested?
360(1)
34.4 Types of Testing
360(4)
34.4.1 Unit Testing
362(1)
34.4.2 Integration Testing
362(1)
34.4.3 System Testing
363(1)
34.4.4 Installation Testing
363(1)
34.4.5 Smoke Tests
364(1)
34.5 Automating Testing
364(1)
35 Scala Testing 365(18)
35.1 Introduction
365(1)
35.2 Scala Runtime Test Facilities
365(2)
35.2.1 Validation Checks
365(1)
35.2.2 Using Require and Assert
366(1)
35.3 Test Libraries in Scala
367(1)
35.3.1 ScalaTest
367(1)
35.3.2 Spec
367(1)
35.3.3 ScalaCheck
367(1)
35.4 ScalaTest Testing Framework
368(10)
35.4.1 Setting up your Scala Project
368(4)
35.4.2 ScalaTest and JUnit
372(5)
35.4.3 Scala Test and Functional Test Suites
377(1)
35.5 ScalaTest and Feature Tests
378(2)
35.6 Test Driven Development
380(2)
35.6.1 The TDD Cycle
380(1)
35.6.2 Test Complexity
381(1)
35.6.3 Refactoring
382(1)
References
382(1)
Further Reading
382(1)
36 Introduction to Akka Actors 383(16)
36.1 Introduction
383(1)
36.2 The Actor Model
383(1)
36.3 Some Terminology
384(1)
36.4 Scala Threads
385(1)
36.5 Akka Scala Actor library
386(2)
36.6 Concurrent Hello World
388(2)
36.7 Concurrent Actors
390(2)
36.8 The Akka Actor API
392(1)
36.9 Actor Lifecycle
392(3)
36.10 Akka Configuration
395(1)
36.11 Actor DSL
396(3)
37 Further Akka Actors 399(14)
37.1 Introduction
399(1)
37.2 Generating a Result from an Actor
399(2)
37.3 Futures
401(3)
37.4 Dispatchers
404(3)
37.5 Actor Hierarchies
407(1)
37.6 Actor Supervision
408(3)
37.7 Good Practices
411(1)
Online References
412(1)
38 Play Framework 413(16)
38.1 Introduction
413(1)
38.2 Introduction to Play
413(2)
38.3 Starting with Play
415(4)
38.3.1 Download Play
415(1)
38.3.2 Unzip Play
415(1)
38.3.3 Setting up the Play Environment
415(1)
38.3.4 Creating a New Web Application
416(3)
38.4 Starting the Web Application
419(1)
38.5 Editing the Application
420(3)
38.5.1 Importing into Eclipse
420(1)
38.5.2 Working with the Application
421(2)
38.6 Model View Controller
423(2)
38.7 Exploring the Play Application
425(4)
39 RESTful Services 429(14)
39.1 Introduction
429(1)
39.2 RESTful Services
429(1)
39.3 A RESTful API
430(1)
39.4 Creating the RESTful Web Application
431(4)
39.5 JavaScript and jQuery
435(1)
39.6 The jQuery Client
436(5)
Further Reading
441(2)
40 GUIs in Scala Swing 443(12)
40.1 Introduction
443(1)
40.2 Windows as Objects
443(1)
40.3 Windows in Scala
444(1)
40.4 Scala Swing
444(2)
40.5 Scala Swing Packages
446(1)
40.6 Swing Scala Worked Examples
447(8)
40.6.1 Simple Hello World UI
447(1)
40.6.2 Panels and UI Layout
448(2)
40.6.3 Working with a BorderPanel
450(1)
40.6.4 Working with a BoxPanel
451(2)
40.6.5 Displaying a Table
453(2)
41 User Input in Scala Swing 455(10)
41.1 Introduction
455(1)
41.2 Handling User Input
455(7)
41.2.1 Scala Swing Actions
458(2)
41.2.2 Working with Menus
460(2)
41.3 A Simple GUI Example
462(3)
42 Scala Build Tools 465(14)
42.1 Introduction
465(1)
42.2 Why we need a Build Tool
465(1)
42.3 Maven
466(2)
42.3.1 Maven Repositories
468(1)
42.4 The Maven POM
468(1)
42.5 Scala and Maven
469(3)
42.6 Maven Lifecycle Commands
472(1)
42.7 SBT
472(5)
42.7.1 Creating an SBT Project
474(2)
42.7.2 SBT Lifecycle Commands
476(1)
Further Readings
477(2)
43 Scala & Java Interoperability 479
43.1 Introduction
479(1)
43.2 A Simple Example
479(1)
43.3 Inheritance
480(1)
43.4 Issues
481(7)
43.4.1 Scala Objects
482(1)
43.4.2 Companion Modules
483(2)
43.4.3 Traits
485(3)
43.5 Functions
488(2)
43.6 Collection Classes
490(2)
43.7 Implementing a Java Interface
492
John Hunt is a technology trainer, consultant, mentor and author who has 30 years experience within the computing industry. He has worked extensively in Object Oriented technologies over the last 20 years, although his career began with writing LISP on a Symbolics Lisp Machine. He first encountered Scala in 2010 through an organization with which he was working. Since then he has been involved in several Scala projects and has worked with a number of teams on developing their Scala skills.