Java 2023, A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles
Java developers usually tackle the complexity of software development through object-oriented programming (OOP). But not every problem is a good match for OOP. The functional programming (FP) paradigm offers you another approach to solving problems, and Java provides easy-to-grasp FP tools such as lambdas and streams. If you're interested in applying FP concepts to your Java code, this book is for you.
Author Ben Weidig highlights different aspects of functional programming and shows you how to incorporate them in your code without going "fully functional." You'll learn how, when, and why to use FP concepts such as immutability and pure functions to write more concise, reasonable, and future-proof code. Many developers seek to expand their horizons by using OOP and FP together. It's no longer either-or; it's both.
In two parts, this book includes:
-A Functional Approach: Get a high-level overview of functional programming, including the types already available to Java developers. Then explore different FP concepts and learn how to use them.
-Real-World Problems, Patterns, and Recipes: Apply what you've learned in part one to the typical real-world problems you might encounter in your daily work.
What You Will Learn?
*A functional approach will lead to many advantages in your code:
*Composition: Build modular and easy composable blocks.
*Expressiveness: Write more concise code that clearly expresses its
intent.
*More reasonable code: Safer data structures without side-effects that
don’t need to deal with locks or race conditions.
*Modularity: Break down larger projects into more easily manageable
modules.
*Maintainability: Smaller functional blocks with less interconnection
make changes and refactoring safer without breaking other parts of
your code.
*Data manipulation: Build efficient data manipulation pipelines with
less complexity.
*Performance: Immutability and predictability allow to scale
horizontally with parallelism without much thought about it.
*Testing