Muutke küpsiste eelistusi

Beginning Scala 3: A Functional and Object-Oriented Java Language 3rd ed. [Pehme köide]

  • Formaat: Paperback / softback, 321 pages, kõrgus x laius: 254x178 mm, kaal: 655 g, 34 Illustrations, black and white; XXII, 321 p. 34 illus., 1 Paperback / softback
  • Ilmumisaeg: 26-Jan-2022
  • Kirjastus: APress
  • ISBN-10: 1484274210
  • ISBN-13: 9781484274217
  • Pehme köide
  • Hind: 57,96 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Tavahind: 68,19 €
  • Säästad 15%
  • Raamatu kohalejõudmiseks kirjastusest kulub orienteeruvalt 2-4 nädalat
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Tellimisaeg 2-4 nädalat
  • Lisa soovinimekirja
  • Formaat: Paperback / softback, 321 pages, kõrgus x laius: 254x178 mm, kaal: 655 g, 34 Illustrations, black and white; XXII, 321 p. 34 illus., 1 Paperback / softback
  • Ilmumisaeg: 26-Jan-2022
  • Kirjastus: APress
  • ISBN-10: 1484274210
  • ISBN-13: 9781484274217
Learn the latest version of Scala through simple, practical examples. This book introduces you to the Scala programming language, its object-oriented and functional programming characteristics, and then guides you through Scala constructs and libraries that allow you to assemble small components into high-performance, scalable systems.





Beginning Scala 3 explores new Scala 3 language features such as Top-level declarations, Creator applications, Extension methods to add extra functionality to existing types, and Enums. You will also learn new ways to manipulate types via Union types, intersection, literal, and opaque type aliases. Additionally, youll see how Implicits are replaced by given and using clauses.





After reading this book, you will understand why Scala is judiciously used for critical business applications by leading companies such as Twitter, LinkedIn, Foursquare, the Guardian, Morgan Stanley, Credit Suisse, UBS, and HSBC and you will be able to use it in your own projects.





What You Will Learn









Get started with Scala 3 or Scala language programming in general Understand how to utilitze OOP in Scala Perform functional programming in Scala Master the use of Scala collections, traits and implicits Leverage Java and Scala interopability Employ Scala for DSL programming Use patterns and best practices in Scala





Who This Book Is For





Those with a background in Java and/or Kotlin who are new to Scala.  This book is also for those with some prior Scala experience who want to learn Scala version 3. 
About the Authors xiii
About the Technical Reviewer xv
Acknowledgments xvii
Introduction xix
Chapter 1 Getting Started with Scala
1(20)
Why Use Scala?
1(2)
Migrating to Scala 3
3(2)
History
5(3)
Installing Scala Tools
8(1)
Installing Java JDK
8(1)
Installing Scala
9(2)
Installing SBT
11(1)
Installing the IDE
12(1)
Running Code Examples
13(1)
Using an IDE
13(1)
Manually Using the REPL
14(4)
Online Tools
18(2)
Summary
20(1)
Chapter 2 Basics of Scala
21(30)
Variables
21(3)
Scala Type Hierarchy
24(1)
Numeric Types
25(2)
Boolean
27(1)
Char
28(1)
Unit
28(1)
Strings
28(4)
Date
32(2)
Arrays
34(2)
Lists
36(1)
Null
37(1)
Nothing
37(1)
Functions
38(1)
Control Structures
39(1)
if/then/else Expressions
39(2)
For Loops
41(1)
While Loops
42(1)
Match Expressions
43(1)
try/catch/finally Blocks
44(1)
Comments
45(1)
Running Code Without the REPL
45(2)
Keywords
47(2)
Summary
49(2)
Chapter 3 Object-Oriented Modeling
51(28)
Concepts of OOP
51(3)
From Concepts to Concrete Things
54(2)
Classes
56(2)
Fields
58(1)
Constructors
59(4)
Methods
63(2)
Inheritance
65(2)
Inner Classes
67(1)
Value Classes
67(2)
Packages and Imports
69(1)
Multiple Imports
70(1)
Exclude Class
70(1)
Objects
71(1)
Defining Singletons
71(1)
Companion Objects
72(1)
Static Factory
73(1)
Opaque Types
73(2)
Export Clauses
75(1)
Summary
76(3)
Chapter 4 Functional Programming
79(32)
What Is Functional Programming?
80(1)
Pure Functions
81(1)
Side Effects
82(1)
Referential Transparency
82(1)
Expression-Oriented Programming
83(1)
Functions, Lambdas, and Closures
84(1)
Function Literal/Anonymous Function
85(3)
First-Class Functions and Higher-Order Functions
88(3)
Closure
91(1)
Partially Applied Functions
92(1)
Curried Functions
93(1)
Function Compositions
94(2)
Function Error Handling
96(1)
Tail Calls and Tail Call Optimization
97(2)
Call-by-Name, Call-by-Value, and General Laziness
99(2)
Functional Structures
101(1)
Sequence
101(1)
Maps
102(2)
Sets
104(1)
Tuples
105(1)
Options
106(1)
Functional Operations
107(1)
Traversing
107(1)
Mapping
108(1)
Filtering
108(1)
Summary
109(2)
Chapter 5 Pattern Matching
111(24)
Basic Pattern Matching
111(4)
Matching Any Type
115(1)
Testing Data Types
116(1)
Pattern Matching in Lists
117(1)
Pattern Matching and Lists
118(2)
Compiler Optimization
120(1)
Tableswitch
121(1)
Lookupswitch
121(1)
Considerations
122(1)
Pattern Matching with the Matchable Trait
122(1)
Pattern Matching and Case Classes
123(2)
Nested Pattern Matching in Case Classes
125(1)
Pattern Matching as Functions
126(2)
Pattern Matching on Regular Expressions
128(1)
Object-Oriented and Functional Tensions
129(1)
Shape Abstractions
130(4)
Summary
134(1)
Chapter 6 Scala Collections
135(38)
Scala Collection Hierarchy
136(1)
The scala collection Package
137(3)
The scala collection immutable package
140(3)
The scala collection mutable package
143(4)
Using Immutable Collection Classes
147(1)
Vector
148(2)
Listrj]
150(8)
Range
158(1)
Stream or LazyList
158(2)
Tuples
160(1)
Map[ K,V]
161(3)
Mutable Collections
164(1)
Mutable ArrayBuffer
165(1)
Mutable Queue
166(1)
Mutable Stack
167(1)
Performance of the Collections
168(2)
Summary
170(3)
Chapter 7 Traits and Enums
173(24)
Traits
173(2)
Using Traits as Mixins
175(4)
Traits and Class Hierarchies
179(6)
Conflicts of Method Names
185(1)
Limiting the Use of a Trait
186(2)
Type Parameters or Type Members
188(1)
Passing Parameters on Traits
189(1)
Enumerations
189(2)
Algebraic Data Types in Enums
191(2)
Union and Intersection Types
193(2)
Summary
195(2)
Chapter 8 Scala Type System
197(22)
Unified Type System
197(3)
Type Parameterization
200(1)
Variance
201(7)
Rules of Variance
208(1)
Type Bounds
208(1)
Upper Type Bounds
208(2)
Lower Type Bounds
210(1)
Extension Methods
210(1)
Scala 2 Implicit Class
211(3)
Scala 3 Given/Using Clauses
214(3)
Summary
217(2)
Chapter 9 Scala and Java Interoperability
219(18)
Scala at a Glance
219(1)
Translating Java Classes to Scala Classes
220(2)
Translating Java Imports into Scala Imports
222(1)
Translating Multiple Constructors
223(3)
JavaBean Specification-Compliant Scala Classes
226(2)
Java Interfaces and Scala Traits
228(2)
Java Static Members and Scala Objects
230(1)
Handling Exceptions
231(2)
Java Optional and Scala Option
233(1)
Use Java Collections in Scala
234(2)
Summary
236(1)
Chapter 10 DSL and Parser Combinator
237(10)
A Closer LookatDSLs
237(2)
Internal DSLs
239(6)
External DSLs
245(1)
Summary
245(2)
Chapter 11 Simple Build Tool
247(16)
Getting Started with SBT
249(1)
Why SBT?
249(1)
Installing SBT
250(1)
General Commands
250(1)
Creating a Hello World Project
251(2)
Project Structure
253(4)
Build Definition
257(1)
LibraryDependencies and Resolvers
258(2)
Plugins
260(1)
Summary
261(2)
Chapter 12 Creating Web Applications
263(24)
Architecture Types
263(7)
Setting Up the Application
270(3)
Application Flow
273(3)
Rest Application
276(9)
Summary
285(2)
Chapter 13 Testing Your Code
287(14)
Testing with ScalaTest
287(2)
Writing Your First Test
289(2)
Ignoring the Execution of the Test
291(1)
Other Ways of Declaring the Test
292(3)
Using Matchers to Validate Results
295(1)
Tagging Your Test
296(2)
Before and After Methods
298(1)
Summary
299(2)
Chapter 14 Scala Best Practices
301(14)
General Best Practices
301(1)
Recognizing the Functional Style
302(2)
Writing Pure Functions
304(1)
Leveraging Type Inferencing
305(1)
Think Expressions
306(2)
Focusing on Immutability
308(1)
Keeping Methods Short
309(1)
Using Options Instead of Null Testing
310(1)
Refactor Mercilessly
311(2)
Composing Functions and Classes
313(1)
Summary
313(2)
Index 315
David Pollak has been writing commercial software since 1977. He wrote the award-winning Mesa spreadsheet, which in 1992 was the first real-time spreadsheet. Wall Street companies traded billions of dollars a day through Mesa. In 1996, David sold his company to CMP Media and became CTO of CMP Media's NetGuide Live and was one of the first large-scale users of Java and WebLogic to power an Internet site. In 1998, David released Integer, the world's first browser-accessible, multiuser spreadsheet. Since 2000, David has been consulting for companies including Hewlett-Packard, Pretzel Logic/WebGain, BankServ, Twitter, and SAP. David has been using Scala since 2006 and is the lead developer of the Lift Web framework.

Vishal Layka is the chief technology officer of Star Protocol. He is involved in the architecture, design, and implementation of distributed business systems, and his focus is on consulting and training with the JVM languages. Hislanguage proficiencies include Java, Groovy, Scala, and Haskell. Vishal is also the lead author of Beginning Groovy, Grails, and Griffon (Apress, 2012). When he needs a break from technology, Vishal reads eclectically from calculus to star formation. Andres Sacco has been a professional developer since 2007, working with a variety of languages, including Java, Scala, PHP, NodeJs, and Kotlin. Most of his background is in Java and the libraries or frameworks associated with it, but since 2016, he has utilized Scala as well, depending on the situation. He is focused on researching new technologies to improve the performance, stability, and quality of the applications he develops.