Yep, a service is the canonical solution--my impression was that the OP was trying to avoid *any* knowledge of the additional search stuff, but composing capabilities via services sure seems like the easiest thing to do.
Dave On Mon, Aug 1, 2011 at 9:32 AM, Aaron Brown <[email protected]> wrote: > If I were coding the search part, I'd probably place the secondary > piece inside a searching business service. Your action would > instantiate a search business service and ask it to get search results > based on a query string. The business service would do that and also > (based on whatever business logic you like) would do whatever extra > things were appropriate. The action never knows or cares about it, and > your low-level data access piece doesn't know either. It's the service > layer's job to understand the complexities and related activities that > go with the basic requests from the Action. > > My two cents. > > - Aaron > > On Sun, Jul 31, 2011 at 12:50 PM, Marcus Bond <[email protected]> wrote: >> Hi, >> >> >> >> Say I have a form where user can carry out a product search which hits an >> action and returns a list of results - easy.. however in response to the >> user changing their search criteria I want to also generate some search >> terms which would be passed through to Ebay, google ads etc.. but not within >> my action which is designed with one purpose in mind - to search my db (the >> action doesn't know about google ads, ebay, AWS or any other thing that >> comes along). Gut reaction here is to fire an event (say product changed) >> and have some listeners do the work of generating the relevant google / ebay >> stuff and storing this in the users session. >> >> >> >> Firstly, is this how most of you would go about it? >> >> >> >> Secondly in terms of the view side of things, whilst normally my action >> would simply return 'success' I may want to tweak the view depending upon >> which external source returned the best results (currently I use tiles but I >> don't think I can or should dynamically switch the result after my action >> has processed).. How would you tackle this? By adding logic to the tile / >> template jsp or some other means? >> >> >> >> Can any of you share experiences of using Struts in apps like this and how >> you tackled similar scenarios or if maybe another framework is more suited? >> You'll have to bear with me here since all my work thus far has had no need >> to collaborate data from multiple sources in one page. >> >> >> >> Regards and thanks in advance, >> >> Marcus >> >> > > > > -- > Aaron Brown : [email protected] > > --------------------------------------------------------------------- > 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]

