© Kelt Dockins 2017

Kelt Dockins, Design Patterns in PHP and Laravel, 10.1007/978-1-4842-2451-9_16

16. Chain of Responsibility

Kelt Dockins

(1)Dolph, Arkansas, USA

$> git checkout chain_of_responsibility

Intent

Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.1

Applications

Many things in life follow the Chain of Responsibility pattern: the military, businesses, and even casino slot machines. Take, for example, a call to your cell phone company’s customer support. It usually starts with the automated voice system . If that doesn’t satisfy you, then you are transferred to basic tier 1 support, ...

Get Design Patterns in PHP and Laravel now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.