Chain-of-responsibility pattern |
In computer programming, the chain-of-responsibility pattern is a design pattern (computer science) consisting of a source of Command pattern 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.
. 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.
The article is originally from Perl Design Patterns Book
=Disambiguation=
=See also=
*Interception pattern *Interceptor pattern
=External links=
*Article [http://www.javaworld.com/javaworld/jw-08-2004/jw-0816-chain.html The Chain of Responsibility pattern s pitfalls and improvements] by Michael Xinsheng Huang *Article [http://www.javaworld.com/javaworld/jw-08-2003/jw-0829-designpatterns.html Follow the Chain of Responsibility] by David Geary *Article [http://developer.com/java/other/article.php/631261 Pattern Summaries: Chain of Responsibility] by Mark Grand *[http://dofactory.com/Patterns/PatternChain.aspx CoR overview] *[http://research.microsoft.com/~minka/patterns/CoR.html Chain of Responsibility Pattern] *[http://allapplabs.com/java_design_patterns/chain_of_responsibility_pattern.htm Behavioral Patterns - Chain of Responsibility Pattern] *[http://home.earthlink.net/~huston2/dp/chain.html Chain of Responsibility] *[http://c2.com/cgi/wikiChainOfResponsibilityPattern Descriptions from Portland Pattern Repository]|
|