Home Page Icon
Home Page
Table of Contents for
Java 8 Lambdas
Close
Java 8 Lambdas
by Richard Warburton
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
What’s 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
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
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
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
Preface
Java 8 Lambdas
Richard
Warburton
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset