The four patterns—one from each of the four categories—could be the following:
- Creational patterns: Factory method
- Structural patterns: Composite
- Behavioral patterns: Visitor
- Concurrency patterns: Messaging pattern
In this book, we have already used the following patterns:
- Lazy initialization: In Chapter 6, Interfaces, Classes, and Object Construction, we initialized the SingletonClassExample OBJECT static field, not automatically, but only when the getInstance() method was called
- Singleton: In Chapter 6, Interfaces, Classes, and Object Construction, see the SingletonClassExample class
- Facade: In Chapter 6, Interfaces, Classes, and Object Construction, when we created a Calculator interface that captures all possible interactions ...