
Hi, Habrozhiteli! Finally, we can offer you the results of the titanic work of our translators and editors - the long-awaited classic edition on the Scala language. Anyone who knows the abbreviation JVM and is not alien to functional programming will undoubtedly appreciate this book (it is impossible to overestimate it). The main author of this folio is Martin Oderski, the developer and ideologist of the Scala language, who stood at its very source. This book will be an indispensable acquisition for all serious professionals with experience with Java and JVM. The authors sought to teach the reader everything necessary to confidently write in the Scala language workable and even combat-ready applications. All examples in the publication are compiled using Scala version 2.11.7, with the exception of those marked 2.12, they are compiled using version 2.12.0-M3
Who is this book for?
The book is mainly designed for developers who want to learn how to program or create another Scala project. In addition, the publication should be of interest to those who want to expand their horizons, having studied new concepts. If you, for example, program in Java, then in this book you will find for yourself a variety of functional programming concepts, as well as advanced concepts from the field of object-oriented programming. We are sure that the study of Scala and the ideas embodied in this language will help you to improve your professional level as a programmer.
Content Overview
• Chapter 1, Scalable Language, provides an overview of the design of the Scala language, as well as the associated rationales and historical events.
')
• Chapter 2, “First Steps in Scala”, shows how the language solves the main programming tasks, without going into details regarding the features of the mechanisms of the language. The purpose of this chapter is to begin the practical work of typing and running the Scala code.
• Chapter 3, “Next Steps in Scala,” demonstrates the more complex functionality of the Scala language. After reviewing the material, you can start using Scala to write scripts that solve simple problems.
• Chapter 4 “Classes and Objects” is the beginning of an in-depth look at the Scala language, with a description of its main object-oriented building blocks and instructions for compiling and running Scala applications.
• Chapter 5 "Basic Types and Operations" covers the main types of Scala, their literals, the operations that can be performed on them, issues of the work of levels of priority and associativity and gives an idea about enriching shells.
• Chapter 6, “Functional Objects,” deepens the idea of ​​Scala's object-oriented properties, using functional (that is, immutable) rational numbers as an example.
• Chapter 7, Embedded Control Structures, shows how to use Scala's built-in control structures if, while, for, try, and match.
• Chapter 8, Functions and Circuits, considers in depth functions as the basic building blocks of functional languages.
• Chapter 9, “Managing Abstractions,” demonstrates ways to improve the main Scala governing structures by defining your own governing abstractions.
• Chapter 10 Composition and Inheritance considers the additional support for object-oriented programming that Scala has. Topics covered are not of the same fundamental nature as those described in Chapter 4, but the issues addressed in them are often encountered in practice.
• Chapter 11, “Hierarchy in Scala,” explains the inheritance hierarchy in Scala and discusses generic methods and inferior types.
• Chapter 12 “Traits” covers the mechanism for creating blending compositions that exists in Scala. The work of treits is shown, examples of their most frequent use are described, and it is explained how traditional multiple inheritance is improved with the help of treitures.
• Chapter 13, Packages and Imported Code, deals with programming issues in general, including high-level packages, import instructions, and access control modifiers, such as protected and private.
• Chapter 14, “Assertions and Tests” shows the assertion mechanism in Scala and provides an overview of the range of tools available for writing tests in Scala. The focus is on the ScalaTest tool.
• Chapter 15, Case Classes and Pattern Search, introduces duplicate constructs that support your actions when writing ordinary, unencapsulated data structures. Case classes and pattern matching will be of particular benefit when working with tree-like recursive data.
• Chapter 16 “Working with Lists” examines in detail the lists that can be attributed, probably, to the most demanded data structures in Scala programs.
• Chapter 17, “Working with Other Collections,” shows how to use the main Scala collections, such as lists, arrays, tuples, sets, and maps.
• Chapter 18, Variable Objects explains the essence of the variable objects and the syntax provided by Scala for expressing these objects. The chapter concludes with a practical example of modeling a discrete event, which shows a number of objects that are modified in action.
• Chapter 19, “Type Parameterization,” uses specific examples to explain some of the techniques for hiding information presented in Chapter 13, such as creating a class for functional queries. The materials of the chapter lead to the description of the variability of type parameters and the methods of their interaction with information hiding.
• Chapter 20, Abstract Elements, describes all the varieties of abstract elements supported by Scala — not only methods, but also fields and types that can be declared abstract.
• Chapter 21, Implied Conversions and Parameters, considers two constructs that can help rid the source code of unnecessary detail, allowing it to be provided to the compiler itself.
• Chapter 22, Implementing Lists, describes the implementation of the List class. It discusses the work lists in Scala, which is important to understand. In addition, the implementation of lists shows how a number of Scala language features are used.
• Chapter 23, “Returning to for expressions,” shows how expressions for are turned into calls to the map, flatMap, filter, and foreach methods.
• Chapter 24, “In-depth Study of Collections,” offers an in-depth overview of the collections library.
• Chapter 25, Scala Collection Architecture, demonstrates how the collection library is organized and how you can implement your own collections.
• Chapter 26, Extractors, shows how pattern matching can be applied to not only case classes, but also any arbitrary classes.
• Chapter 27 Annotations shows how you can work with language extensions using annotations. The chapter describes several standard annotations and shows how to create your own annotations.
• Chapter 28, “Working with XML,” explains how Scala processes data in XML format. The idioms for creating XML, parsing data in this format, and processing such data after analysis are shown.
• Chapter 29, “Modular Programming Using Objects,” describes how to use Scala objects as a modular system.
• Chapter 30, “Equality of Objects,” highlights a number of issues that need to be considered when writing the equals method. Also describes the bottlenecks that should be avoided.
• Chapter 31, “Combining Scala and Java Codes”, addresses the problems that arise when combining shared Scala and Java codes in the same project, and suggests ways to find solutions to them.
• Chapter 32, Futures and Multi-threaded Computing, shows how to work with the Scala class called Future. Although the Scala programs can use multi-thread computing primitives and libraries used on the Java platform, futures can help avoid the occurrence of deadlocks and competitive conditions that are a curse to traditional approaches to multi-threading in the form of threads and locks.
• Chapter 33, “Syntax analysis using combinators” shows how to create parsers using parser combinators in Scala’s library.
• Chapter 34, “GUI Programming,” offers an overview of the Scala library, which simplifies GUI programming using Swing.
• Chapter 35, The SCells Spreadsheet, links everything together, featuring a full-featured spreadsheet application written in Scala.
»More information about the book can be found on
the publisher's website.
»
Table of Contents
»
Excerpt
For Habrozhiteley a 20% discount on the coupon -
Scala