Craig R. McClanahan wrote (10/4/2003 2:02 PM):
So, implementing this as a single chain would require ValidateActionForm to the success/failure state of the validation into the Context -- easy to do -- and three commands must now (inside their implementation -- the Chain does not know anything about this) surround their current behavior in an "if" statement, which means that they have to know the location of the state information that was saved (slight increase in coupling), and they get processed by the Chain even if they are not relevant (very minor performance impact; almost never enough of a concern to worry about). But it would definitely work.

Yes, the current implementation trades coupling the Commands to the Context with coupling this Command to the Catalog, which I agree is a fair trade under the circumstances. But, TANSTAFL, coupling does increase somewhere, it's just a matter of choosing your battles. :)


Based on using the Command strategy in other implementations, I would guess that people retrofitting code streams (as we are doing here) may often find it simplest to nest Commands. Meanwhlie, people building the business logic from scratch may tend to make more use of the Context so that is easier for Commands to skip themselves.

-Ted.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to