wood burning stoves 2.0*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Chain of Responsibility Pattern [GoF] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Chain of Responsibility Pattern [GoF]" Watch "Chain of Responsibility Pattern [GoF]" New topic
Author

Chain of Responsibility Pattern [GoF]

Victor M. Pereira
Ranch Hand

Joined: Mar 02, 2012
Posts: 50
I'm studying the gang of four book to add more patterns to what I know. And I've stumbled across the chain of responsibility pattern.

From what I read from the book and the internet. I saw two different approaches:

1) Traverses whole tree of successions and applies every handle that can do something with the data. This seemed like a if applicable decorate.

2) This one was traverse the tree until someone can do something about it, if it ends have a default.

The main problem is that I can't see myself using them. Since, most internet examples aren't really CoR but some mock of Strategy. In what cases can I really say
this is without a doubt CoR (Chain of Responsibility).


regards,
Victor M. Pereira
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1763
    
    7

Servlet filters come to mind as an example of this pattern in practice.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Chain of Responsibility Pattern [GoF]