Craig R. McClanahan wrote:
* The way it's currently implemented -- ValidateActionForm conditionally branches to a separate chain on validation failure ("servlet-validation-failure" in the current config file), and [returns true to] abandon the remainder of the original chain.
The phrase "conditionally *nests* a separate chain" might be more accurate. Branch implies the Command loses control, which is not the case.
dictionary.com / Computer Science
branch - To relinquish control to another set of instructions or another routine as a result of the presence of a branch.
Nitpicking, I know, but ...
From the perspective of the original chain, this is exactly what happens -- the original chain relinquishes control, and the remainder of the original steps are never actually executed (because ValidateActionForm returns true when the alternate chain is finished).
nest - A set of data contained sequentially within another.
You might recall that the original approach to this functionality really did nest -- ValidateActionForm was a Chain that conditionally executed it's nested commands instead of continuing. As was pointed out then, this was sort of a corruption of the CoR pattern, because the remainder of the original chain is *still* abandoned (because the last command in the nested chain returns true) -- but you can't tell that from looking at a structural diagram of the commands.
It's perfectly reasonable to use nested chains for composing complex things out of simple things -- that's why a Chain is-a Command. But the original feedback was correct -- this shouldn't be used as a structure for conditional processing; explicity branching is better.
-Ted.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
