commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [chain] fixed, one-way chains, only?
Date Tue, 15 Mar 2005 20:54:29 GMT
On Tuesday 15 March 2005 00:33, Martin Cooper wrote:
> I think you may want to read some more on the Chain of Responsibility
> pattern. It has no relationship to trees, so I think perhaps you're
> confusing it with a different pattern. From the GoF book:

Well, if you carefully read the book you'll read as well that the pattern are 
only ideas and not perfect :) That's why you will only find code snippets in 
the original GoF. 

BTW The GoF chain also does not have a state as Commons Chain does have. 

I think the GoF would agree that struts did actually understand the idea 
behind Chain of Reponsibility.

> Chain of Responsibility
> Avoid coupling the sender of a request to its receiver by giving more
> than one object a chance to handle the request. Chain the receiving
> objects and pass the request along the chain until an object handles
> it.
> This doesn't seem to me to be related to the problem you are trying to
> solve.

It does perfectly match my requirement. The only problem it that the chain is 
fixed hierarchical and does not implement any logic which element to be the 
next to be able to handle the object properly. 

So, it's

	A -> B -> C

rather than

   +- B
A -+ (logic)
   +- C

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message