Behavioral patterns decide where work belongs and how objects pass control between one another. A sender need not know the receiver, a client need not own every algorithm, and a publisher need not depend on every subscriber. The patterns make those collaborations explicit.

The catalog covers request pipelines, deferred operations, traversal, coordination, snapshots, notifications, state-dependent behavior, interchangeable algorithms, fixed workflows, operations over object structures, and small languages. The names differ, but each pattern answers the same practical question: which object owns the next decision?

Patterns at a Glance

The patterns are grouped by intent, not by quality or complexity. Several often appear in one design because they solve different parts of the same interaction.

PatternIntentReach for it when
Software Architecture/Patterns/Design Patterns/Behavioral/Chain of ResponsibilityPass a request along a chain of handlers, each choosing to handle it or forward itSeveral objects might handle a request and the handler isn’t known in advance (middleware, escalation)
Software Architecture/Patterns/Design Patterns/Behavioral/CommandEncapsulate a request as an object bundling action, parameters, and receiverOperations need queuing, logging, undo/redo, or replay
Software Architecture/Patterns/Design Patterns/Behavioral/InterpreterDefine a grammar and an interpreter that evaluates sentences of a languageA simple, stable language needs evaluation (rules, expressions, DSLs)
Software Architecture/Patterns/Design Patterns/Behavioral/IteratorProvide sequential access to a collection’s elements without exposing its structureClients must traverse a collection without depending on its internal representation
Software Architecture/Patterns/Design Patterns/Behavioral/MediatorCentralize how a set of components interact, replacing a many-to-many web with one-to-many routingObjects communicate in complex ways and direct references have become tangled
Software Architecture/Patterns/Design Patterns/Behavioral/MementoCapture and externalize an object’s state so it can be restored later, without breaking encapsulationSnapshots are needed for undo, checkpoints, or rollback
Software Architecture/Patterns/Design Patterns/Behavioral/ObserverDefine a one-to-many dependency so a subject’s change notifies all subscribersState changes in one object must fan out to many decoupled listeners (events)
Software Architecture/Patterns/Design Patterns/Behavioral/StateExtract state-specific behavior into classes. The context delegates to its current stateBehavior changes with an internal mode and sprawling conditionals obscure the transitions
Software Architecture/Patterns/Design Patterns/Behavioral/StrategyDefine a family of interchangeable algorithms behind a common interfaceThe client must select or swap an algorithm at runtime
Software Architecture/Patterns/Design Patterns/Behavioral/Template MethodDefine an algorithm’s skeleton in a base class, letting subclasses override specific stepsMultiple variants share a fixed overall structure but differ in individual steps
Software Architecture/Patterns/Design Patterns/Behavioral/VisitorAdd new operations to an object hierarchy without modifying its classes, via double dispatchOperations change often while the class hierarchy changes rarely

References

11 items under this folder.