What it means
CoR UML Digram |
Applications of CoR
- Rule engine to apply n number of rules
- A parsing engine, similar to XML Parsing
- Assigning the responsibility to an available executor, for example, in a chat based support application
And..many more if you look around. My imagination is compilers and interpreters too are based on this design pattern.
References
- http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern
- http://www.onjava.com/pub/a/onjava/2005/03/02/commonchains.html?page=1
- http://programmers.stackexchange.com/questions/130686/is-there-a-design-pattern-that-would-apply-to-discount-models
How it is similar or different from other patterns?
Often, the question arises, why CoR is different from Strategy, decorator and command etc. Below are the links where we can find some useful discussion:
- http://stackoverflow.com/questions/747913/why-would-i-ever-use-a-chain-of-responsibility-over-a-decorator
- http://stackoverflow.com/questions/5039024/whats-the-difference-between-chain-of-responsibility-and-strategy-patterns
- http://www.dofactory.com/topic/1167/chain-of-responsibility-vs-observer-pattern.aspx
No comments:
Post a Comment