Behavioral patterns
All different, with no central theme: they describe how objects communicate and share responsibility.
- 1Chain of Responsibility
Passes a request along a chain of handlers; each decides to process it or pass it on.
- 2Command
Turns a request into a stand-alone object containing all information about the request.
- 3Interpreter
Defines a grammar for a simple language and an interpreter that evaluates sentences in it.
- 4Iterator
Traverses elements of a collection without exposing its underlying representation.
- 5Mediator
Reduces chaotic dependencies between objects by making them communicate through a mediator object.
- 6Memento
Saves and restores an object's previous state without revealing its implementation.
- 7Observer
Defines a subscription mechanism that notifies multiple objects about events in the object they observe.
- 8State
Lets an object alter its behaviour when its internal state changes, as if it changed its class.
- 9Strategy
Defines a family of algorithms, puts each in its own class, and makes them interchangeable.
- 10Template Method
Defines the skeleton of an algorithm in a base class and lets subclasses override specific steps.
- 11Visitor
Separates algorithms from the objects on which they operate.