Software Engineering Architecture Lab

Chain of Responsibility Pattern

Pass a request along a chain of handlers. A behavioural pattern in the Design Patterns (GoF) catalog. Explained with Java/Spring code and when not to use it.

Pass a request along a chain of handlers.

Family
Design Patterns (GoF)
Category
Behavioural
Source
Gamma, Helm, Johnson, Vlissides · Head First Design Patterns

More behavioural patterns

  • Strategy — Swap interchangeable algorithms behind one interface.
  • Observer — Notify interested parties when something happens.
  • Command — Turn a request into an object you can queue, log, retry or undo.
  • State — Let an object change behaviour when its internal state changes.
  • Template Method — Fix an algorithm’s skeleton and let subclasses fill in steps.
  • Mediator — Centralise complex communication between many objects.
  • Iterator — Traverse a collection without exposing its internals.

All patterns