Behavioral patterns are those patterns that identify common communication strategies between different entities. By realizing these patterns, you'll increase flexibility when communicating between different parts of your programs.
We'll start by looking at the state pattern, which helps decouple the behavior of a program from its internal state. We'll follow up with the observer pattern, which encompasses the implementation of event-based data flows.
Next, we'll discuss the memento pattern, a very useful pattern that manages to elegantly abstract the ability to roll back between states. Finally, we'll cover the visitor and strategy patterns, which both help to abstract complexity when implementing algorithms that evolve at runtime.
In this chapter, we will cover the following topics:
- The state pattern
- The observer ...