Chain-of-responsibility pattern: Difference between revisions

Content deleted Content added
removed perl link, firstly because perl doesn't even do real design patterns
Itschris (talk | contribs)
Disambiguation link repair - You can help!
Line 1:
In [[computer programming]], the '''chain-of-responsibility pattern''' is a [[design pattern (computer science)|design pattern]] consisting of a source of [[Command pattern|command objects]] and a series of '''processing objects'''. Each processing object contains a set of logic that describes the types of command objects that it can handle, and how to pass off those that it cannot to the next processing object in the chain. A mechanism also exists for adding new processing objects to the end of this chain.
 
'''[[Permutation]]s''': Commands may be sent in alternate directions out, forming a tree of [[responsibility]]. Recursion could continue until the command is processed, or the entire tree has been explored. An XML interpreter (parsed, but not yet executed) might be a fitting example.
 
This pattern promotes the idea of [[loose coupling]], a programming practice.