Related to this, how come Command.execute returns boolean instead of returning Command? If it returned Command this would basically eliminate the need for a Chain interface altogether. Chain would become a concrete implementation of Command that repeatedly executed Commands until the last command executed returned null (which would be the new value to indicate the end of a chain).
If Command returned a Command reference, each Command would have to know what the next Command in the chain is, which, IMO, would introduce too tight coupling between Commands. Why use configurable chains if you're going to programatically hardwire the next step in the process. The Chain interface exists to signify separately from the Commands themselves the set of commands that are to be run in a process. The Command returns boolean so that you can "break" execution at any point in the chain. Look at the current RequestProcessor interface in Struts. Some of the processing methods return boolean to indicate that processing should not continue to the next "link."
If the interface was changed from what it is now, I'd prefer an approach that looks more like Servlet Filters where you call doNextCommand() without regard to what the next command is over an approach where you determine what the next command is, but I'm cool with the interface the way it exists now as well.
Greg
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
