On 2/19/06, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > On 2/19/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: > > Anyone can quote chapter and verse from the GoF book. Can you instead > > explain *why* what's in Struts isn't CoR? And, perhaps more > > importantly, explain why, even if it isn't an exact match for the > > pattern, it matters one bit? > > By the way, is Struts CoR actually a CoR? This is not a trick > question, I am just asking.
I think one of the reasons the current processing chain is so complex is because it just refactors the old set of method calls into a set of commands. This is a good starting point, but there is more we could do. The next step might be to anaylze the different scenarious the current guantlet is trying to cover and compose those into different chains. Which chain is called would depend on the nature of the request. For example, there no reason to call a processing chain that includes handling uploads if the request isn't doing uploads. Or code that handles modules if modules are not being used. One idea might be to build the processing chain dynamically on a per request basis. Though, and even better approach might be to follow WebWork's lead and arrange for each Action to have it's own processing chain. There could be a default chain for the application, which an individual action would be use, replace, or extend. In our ASPX applications, we build the web processing chain dynamically on each request. There is a "pre-opt" chain and a "post-opt" chain, and an Action Command (which could also be a chain). When the request comes in, we create a new chain, and add the pre-opt chain, the Action chain, and post-opt chain to the new dynamic chain, and then execute that. Of course, a benefit here is that it is easy to test the Action chain in isolation, along with the individual commands. The pre-opt and post-opt chains can also be tested in isolation. -Ted. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]