Suppose team T1 invents a generic web search engine component.
Let say another team T2 wanted to use that component, say
embed it is in own JSP views using say Tiles.
How does the search component forward or transfer control to the external component that T2.
One way could be to use an action chain. First, one writes a Struts
Action in such way that it puts a known public bean or put the bean
in the form bean. Whatever. This Output Bean contains contains
your search result or selected object. Second, one can generate a dynamic ActionForward that names the second Action
to forward.
But I am thinkgin Craig has given us an alternative option, of maybe using a Command to do this. But if and only if an Action is refactored as a Command.
Personally, I wouldn't bother dragging an Action into it. Just do the whole thing as a Command/Chain. The Action collect the parameters, puts them into the Context, and passes the Context down to Chain. Chain executes the search and passes the Context back. The Action's one and only job is as an adapter that transfers attributes between the HTTP Context and the Chain Context.
I think when we start pursuing this strategy, servlets/actions as adapters, we start moving from Model 2 to Model 3.
What's Model 3? Here's something I wrote up this morning:
Model 1 uses a server page to conduct the business operations and render the dynamic data generated by the business operation.
Model 2 uses a servlet to conduct the business case processing and a server page to render the dynamic data generated by the servlet.
Model 3 uses an independent set of classes ("POJOs") to conduct the business operations and a server page to render the dynamic data; a servlet (or filter) acts as a thin adapter between the business classes and server pages.
-Ted.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
