> -----Original Message----- > From: Ted Husted [mailto:[EMAIL PROTECTED] > > > PILGRIM, Peter, FM wrote: > > 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.
Page-centric developments using JavaServer Pages or other view technology with the business code directly embedded in the view. > > Model 2 uses a servlet to conduct the business case processing and a > server page to render the dynamic data generated by the servlet. Use a `FrontController' pattern to pass requests to action object that follow the `Command' pattern. These command (Struts Action) interface between the view layer and the business layer. > > 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. > Use a `FrontController' pattern to pass requests to `Command' object that can be chained together arbitrarily and configurably. This presupposes the existence of a glue layer (Common Chains / Request Processor). I think this what yout meant. If you have Poseidon UML then take a look. > > -Ted. > -- Peter Pilgrim, Struts/J2EE Consultant, RBoS FM, Risk IT Tel: +44 (0)207-375-4923 *********************************************************************************** This e-mail is intended only for the addressee named above. As this e-mail may contain confidential or privileged information, if you are not the named addressee, you are not authorised to retain, read, copy or disseminate this message or any part of it. The Royal Bank of Scotland plc is registered in Scotland No 90312 Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB Regulated by the Financial Services Authority Visit our website at http://www.rbs.co.uk/CBFM/ ***********************************************************************************
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]