Summary
In this chapter, we explored our first GoF design patterns. These patterns expose some of the essential basics of software engineering—not necessarily the patterns themselves but the concepts behind them:
- The Strategy pattern is a behavioral pattern that we use to compose most of our future classes. It allows you to swap behavior at runtime by composing an object with small pieces and coding against interfaces, following the SOLID principles.
- The Abstract Factory pattern introduces the idea of abstracting away object creation, leading to a better separation of concerns. More specifically, it aims to abstract the creation of object families and follow the SOLID principles.
- Even if we defined it as an anti-pattern, the Singleton pattern brings application-level objects to the table. It allows you to create a single instance of an object that lives for the whole lifetime of a program. The pattern violates most SOLID principles.
We also peeked...