• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Command pattern doutb

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I use command pattern to search? I explain me:

In petstore actions are used to change the state of model or user's session but not to search. In this case action only return a Integer to the front controller in order to decide the next screen.

Could I use the actions to search. Is said that actions return information (ValueObject) to the views ?


Thanks.
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can, but I recommend using a Fast Lane reader pattern.

http://java.sun.com/blueprints/patterns/FastLaneReader-detailed.html
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Giju,

If the FastLaneReader is a DAO accessed by a EJB, does it make sense to use a stateful EJB to save the list?
Thanks
Annick
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then use VLH pattern.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jose,
What do you mean by the following?
"In petstore actions are used to change the state of model or user's session but not to search. In this case action only return a Integer to the front controller in order to decide the next screen."

Each action in petstore returns a Response and the response can be any serializable java object? The response object is set in the request attribute and the can be used to display result to the user.

So I don't see any reason why one cannot use this for search results. In fact if you use the VLH and get results page by page also, I think it will be passed through the EventResponse. But you can use a ViewHelper Tag libraries to connect to the Business tier and then get the results too...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic