You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,18 @@ Define the skeleton of an algorithm in an operation, deferring some steps to sub
44
44
45
45
* A class defines many behaviors, and these appear as multiple conditional statements in its operations. Instead of many conditionals, move related conditional branches into their own Strategy class.
46
46
47
+
48
+
#### 5.Chain of Responsibility
49
+
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 request along the chain until an object handles it. [example](https://github.com/hbrawnak/php-design-pattern/blob/master/ChainOfResponsibility/index.php#L3)
50
+
51
+
##### Applicability:
52
+
Use the Chain of Responsibility pattern when
53
+
54
+
* More than one object may handle a request, and the handler isn't known a priori. The handler should be ascertained automatically.
55
+
56
+
* You want to issue a request to one of several objects without specifying the receiver explicitly.
47
57
58
+
* The set of objects that can handle a request should be specified dynamically.
0 commit comments