Functional programming is a programming paradigm that emphasizes the use of functions to break down a problem into subtasks. Everything is done with functions, and the building blocks are just functions. This is in contrast to other paradigms, such as object-oriented programming, where a problem is solved based on objects that contain data and procedures or methods that can modify said data. Some of the most popular functional programming languages are LISP, Scheme, Haskell, Erlang, and Clojure. Java is considered an object-oriented language; however, in version 8, some features were added to facilitate a partial functional programming style. The goal of the book is to show how two of these features, functional interfaces and lambda expressions, are used to organize and simplify Java programs.
The book can be divided into three sections. The first section (chapters 1 and 2) introduces functional interfaces and lambda expressions. These two chapters must be read to follow the rest of the book. In the second section (chapters 3 to 7), five of Java’s main functional interfaces are presented: predicates, functions, operators, consumers, and suppliers, each in its own chapter. The treatment of each functional interface is exhaustive and includes many examples. This adds value to the book because it can later be used as a reference. The third section (chapters 8 to 15) shows the application of functional interfaces in different programming tasks. Each chapter presents a task: traversing objects, collections, comparing objects, optionals, streams, multithread programs, atomic calculations, and JavaFX applications. This section is the most practical and is where the reader will learn how to use the functional interfaces.
As a final assessment: the book is well written and the chapters are ordered in a logical way. Each chapter explains the topic in a clear way and contains many code snippets to illustrate the concepts. Each chapter ends with short exercises to reinforce the topic, long exercises where the current subject is used to solve a real-life problem, and a project where the author guides the reader step by step to the solution. Finally, there is an appendix that discusses method references and how they can be used to implement functional interfaces. As an added value, there is a repository on GitHub with the source code of the book. In summary, this book can be used for self-study and as a professional reference. The only prerequisite for reading is knowledge of basic Java programming.
More reviews about this item: Amazon