Chain-of-responsibility pattern: Difference between revisions

Content deleted Content added
m v2.02 - Fixing innerlinks / WP:WCW project (Link equal to linktext)
The page was not consistent regarding single or multiple responsibility. The introduction states single responsibility (as in the GoF definition) but all examples present loggers where more than one receiver can take responsibility for a given action.
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 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==