Content deleted Content added
Added a 'dubious' tag to a statement about how this pattern is an object oriented version of if else if else... for that to be true, the pattern would have to enforce that if one processing object is executed (in other words, is true) then the other processing objects are not executed, as you would experience in an if else if else type block. As it is, any or all of the processing objects could be executed, and that is not possible in an if else if else block. |
mNo edit summary |
||
Line 5:
This pattern promotes the idea of [[loose coupling]].
The chain-of-responsibility pattern is structurally nearly identical to the [[decorator pattern]], the difference being that for the decorator, all classes handle the request, while for the chain of responsibility, exactly one of the classes in the chain handles the request. This is a strict definition of the Responsibility concept in the [[Design Patterns|GoF]] book. However, many implementations (such as loggers below, or UI event handling, or servlet filters in Java, etc.) allow several elements in the chain to take responsibility.
==Overview==
|