Java 8 Lambdas. Pragmatic Functional Programming - Helion
ISBN: 978-14-493-7085-5
stron: 182, Format: ebook
Data wydania: 2014-03-18
Księgarnia: Helion
Cena książki: 126,65 zł (poprzednio: 147,27 zł)
Oszczędzasz: 14% (-20,62 zł)
If you’re a developer with core Java SE skills, this hands-on book takes you through the language changes in Java 8 triggered by the addition of lambda expressions. You’ll learn through code examples, exercises, and fluid explanations how these anonymous functions will help you write simple, clean, library-level code that solves business problems.
Lambda expressions are a fairly simple change to Java, and the first part of the book shows you how to use them properly. Later chapters show you how lambda functions help you improve performance with parallelism, write simpler concurrent code, and model your domain more accurately, including building better DSLs.
- Use exercises in each chapter to help you master lambda expressions in Java 8 quickly
- Explore streams, advanced collections, and other Java 8 library improvements
- Leverage multicore CPUs and improve performance with data parallelism
- Use techniques to “lambdify” your existing codebase or library code
- Learn practical solutions for lambda expression unit testing and debugging
- Implement SOLID principles of object-oriented programming with lambdas
- Write concurrent applications that efficiently perform message passing and non-blocking I/O
Osoby które kupowały "Java 8 Lambdas. Pragmatic Functional Programming", wybierały także:
- Metoda dziel i zwyci 89,00 zł, (26,70 zł -70%)
- Język C. Kurs video. Praktyczne wprowadzenie do programowania 99,00 zł, (29,70 zł -70%)
- Wprowadzenie do Javy. Programowanie i struktury danych. Wydanie XII 193,23 zł, (59,90 zł -69%)
- Spring i Spring Boot. Kurs video. Testowanie aplikacji i bezpiecze 125,42 zł, (45,15 zł -64%)
- Maven. Kurs video. Automatyzacja tworzenia aplikacji w Javie 98,98 zł, (39,59 zł -60%)
Spis treści
Java 8 Lambdas. Pragmatic Functional Programming eBook -- spis treści
- Java 8 Lambdas
- Preface
- Why Should I Read This Book?
- Who Should Read This Book?
- How to Read This Book
- Conventions Used in This Book
- Using Code Examples
- Safari Books Online
- How to Contact Us
- Acknowledgments
- 1. Introduction
- Why Did They Need to Change Java Again?
- What Is Functional Programming?
- Example Domain
- 2. Lambda Expressions
- Your First Lambda Expression
- How to Spot a Lambda in a Haystack
- Using Values
- Functional Interfaces
- Type Inference
- Key Points
- Exercises
- 3. Streams
- From External Iteration to Internal Iteration
- Whats Actually Going On
- Common Stream Operations
- collect(toList())
- map
- filter
- flatMap
- max and min
- A Common Pattern Appears
- reduce
- Putting Operations Together
- Refactoring Legacy Code
- Multiple Stream Calls
- Higher-Order Functions
- Good Use of Lambda Expressions
- Key Points
- Exercises
- Advanced Exercises
- 4. Libraries
- Using Lambda Expressions in Code
- Primitives
- Overload Resolution
- @FunctionalInterface
- Binary Interface Compatibility
- Default Methods
- Default Methods and Subclassing
- Multiple Inheritance
- The Three Rules
- Tradeoffs
- Static Methods on Interfaces
- Optional
- Key Points
- Exercises
- Open Exercises
- 5. Advanced Collections and Collectors
- Method References
- Element Ordering
- Enter the Collector
- Into Other Collections
- To Values
- Partitioning the Data
- Grouping the Data
- Strings
- Composing Collectors
- Refactoring and Custom Collectors
- Reduction as a Collector
- Collection Niceties
- Key Points
- Exercises
- 6. Data Parallelism
- Parallelism Versus Concurrency
- Why Is Parallelism Important?
- Parallel Stream Operations
- Simulations
- Caveats
- Performance
- Parallel Array Operations
- Key Points
- Exercises
- 7. Testing, Debugging, and Refactoring
- Lambda Refactoring Candidates
- In, Out, In, Out, Shake It All About
- The Lonely Override
- Behavioral Write Everything Twice
- Unit Testing Lambda Expressions
- Using Lambda Expressions in Test Doubles
- Lazy Evaluation Versus Debugging
- Logging and Printing
- The Solution: peek
- Midstream Breakpoints
- Key Points
- Lambda Refactoring Candidates
- 8. Design and Architectural Principles
- Lambda-Enabled Design Patterns
- Command Pattern
- Strategy Pattern
- Observer Pattern
- Template Method Pattern
- Lambda-Enabled Domain-Specific Languages
- A DSL in Java
- How We Got There
- Evaluation
- Lambda-Enabled SOLID Principles
- The Single Responsibility Principle
- The Open/Closed Principle
- The Dependency Inversion Principle
- Further Reading
- Key Points
- Lambda-Enabled Design Patterns
- 9. Lambda-Enabled Concurrency
- Why Use Nonblocking I/O?
- Callbacks
- Message Passing Architectures
- The Pyramid of Doom
- Futures
- Completable Futures
- Reactive Programming
- When and Where
- Key Points
- Exercises
- 10. Moving Forward
- Index
- Colophon
- Copyright