Chapter 8. Design and Architectural Principles
The critical design tool for software development is a mind well educated in design principles. It is notâ¦technology.
â Craig Larman
Iâve already established that lambda expressions are a fairly simple change to the Java language and that there are a bunch of ways that we can use them within the standard JDK libraries. Most Java code isnât written by the core JDK developersâitâs written by people like you. In order to use lambda expressions in the most beneficial way possible, you need to start introducing them into your existing code base. They are just another tool in the belt of a professional Java developer, no different from an interface or a class.
In this chapter, weâre going to explore how to use to use lambda expressions to implement the SOLID principles that provide guidelines toward good object-oriented programming. There are also many existing design patterns that can be improved by the use of lambda expressions, and weâll take a look at a smattering of those.
When coding with teammates at work, Iâm sure youâve come across a situation where youâve implemented some feature or fixed a bug, and you were pretty happy with the way that you had done it, but soon after someone else took a look at the same codeâperhaps during a code reviewâand they werenât so happy with it! Itâs pretty common to have this kind of disagreement over what really constitutes good code or bad code.
Most of the time when people ...
Get Java 8 Lambdas now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.