Chapter 7. Supporting Design Patterns Using Functional Programming
In this chapter, we will examine several design patterns and their possible implementations. Under each design pattern, we will begin with a short discussion of the pattern and follow it with an imperative solution and a functional solution. This will highlight the differences between the two approaches and provide the reader with additional experience implementing functional solutions in Java. The intent of this chapter is not necessarily to provide a detailed explanation or justification for each pattern, but rather to illustrate how these patterns can be supported in Java 8.
The general approach is to identify a problem and then apply a design pattern against it. However, this is not always easy. One approach to simplify this task is by breaking an application down into smaller pieces, determine if that piece is a good candidate for a specific design pattern, and then apply the pattern.
Overusing design patterns...