What are behavioral design patterns?
Communicating between objects is key to building software. Behavioral design patterns help us organize this communication and usually decouple the possible implementations from other objects. This makes us more able to extend our code base.
Behavioral design patterns help us follow the open/closed principle, where we can extend functionality without modifying the existing implementation modules.
All the patterns we’ll cover allow us to “add functionality” without modifying the existing consumer/concrete implementation. In large software code bases, this is useful, since it means we can limit the scope of changes and lower the risk of breaking existing functionality. We’re able to effectively de-correlate “adding functionality” from “changing the existing code for other unrelated functionality,” and new features and behaviors can be added without having to do modifications to existing...