Java Reference
In-Depth Information
8.5. Summary
Following are the key concepts you should take away from this chapter:
Lambda expressions can make your code more readable and flexible.
Consider converting anonymous classes to lambda expressions, but be wary of subtle semantic
differences such as the meaning of the keyword this and shadowing of variables.
Method references can make your code more readable compared to lambda expressions.
Consider converting iterative collection processing to use the Streams API.
Lambda expressions can help remove boilerplate code associated with several object-oriented design
patterns such as strategy, template method, observer, chain of responsibility, and factory.
Lambda expressions can be unit tested, but in general you should focus on testing the behavior of the
methods where the lambda expressions appear.
Consider extracting complex lambda expressions into regular methods.
Lambda expressions can make stack traces less readable.
The peek method of a stream is useful to log intermediate values as they flow past at certain points in
a stream pipeline.
 
Search WWH ::




Custom Search