Chain of Responsibility

E173614

Chain of Responsibility is a behavioral design pattern that decouples senders and receivers by passing a request along a chain of potential handlers until one of them processes it.

All labels observed (2)

How this entity was disambiguated

Statements (48)

Predicate Object
instanceOf behavioral design pattern
design pattern
advantage increases flexibility in assigning responsibilities to objects
promotes single responsibility principle among handlers
reduces coupling between sender and receiver
supports dynamic changes to the chain of handlers
alsoKnownAs CoR pattern
Chain of Responsibility
surface form: chain-of-responsibility pattern
applicableWhen handlers should be specified dynamically
more than one object may handle a request
the handler is not known a priori
belongsTo Design Patterns: Elements of Reusable Object-Oriented Software
surface form: Gang of Four design patterns
definesRoleOf Client initiates the request to a handler
ConcreteHandler handles requests it is responsible for
Handler defines interface for handling requests
describedIn Design Patterns: Elements of Reusable Object-Oriented Software
disadvantage can be hard to debug due to indirection
may lead to long chains and performance overhead
no guarantee that a request will be handled
hasCategory behavioral pattern
implementationDetail chain can be implemented via linked references or collections
handlers often implement a common interface or abstract class
intent allow multiple objects a chance to handle a request
avoid coupling the sender of a request to its receiver
decouple senders and receivers of a request
keyConcept chain can be modified dynamically
client does not know which handler will process the request
handler can choose to handle or forward the request
handlers can be added or removed without changing client code
request is passed along the chain until handled
keyOperation handleRequest
originatedFrom work of Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides
participant Client
ConcreteHandler
Handler
relatedTo Command
surface form: Command pattern

Composite pattern
Decorator
surface form: Decorator pattern

Mediator pattern
structure chain of handler objects
each handler maintains a reference to the next handler
linked list of handlers
typicalUseCase GUI frameworks
authorization and authentication checks
event handling systems
logging frameworks
request processing pipelines
technical support escalation chains

How these facts were elicited

Referenced by (2)

Full triples — surface form annotated when it differs from this entity's canonical label.

Chain of Responsibility alsoKnownAs Chain of Responsibility
this entity surface form: chain-of-responsibility pattern