| 1 |
Chain of Responsibility |
Pass request along a chain of handlers |
When multiple objects may handle a request |
| 2 |
Command |
Encapsulate a request as an object |
When you need undo/redo, queuing, or logging of requests |
| 3 |
Iterator |
Access elements sequentially without exposing internals |
When you need uniform traversal of collections |
| 4 |
Mediator |
Define centralized communication between objects |
When many objects communicate in complex ways |
| 5 |
Memento |
Capture and restore object state |
When you need undo/rollback functionality |
| 6 |
Observer |
Notify dependents automatically when state changes |
When one object change should update many others |
| 7 |
State |
Alter behavior when internal state changes |
When behavior depends on state and changes at runtime |
| 8 |
Strategy |
Define interchangeable algorithms |
When you need to select an algorithm at runtime |
| 9 |
Template Method |
Define algorithm skeleton, letting subclasses fill in steps |
When subclasses should customize parts of an algorithm |
| 10 |
Visitor |
Add operations to objects without modifying them |
When you need to perform operations across a class hierarchy |