• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A simple question

 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The authors(Srikanth,Nitin) of 'Struts Survival Guide' state that there is no component of struts in 'model' category of MVC framework.

But I feel that Action class should belong to model category, because it would contain the business logic. Any elaboration on this?

Thanks,
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It makes good design sense to separate your business logic from the struts layer, which is only handling http requests from a browser. What if you wanted to execute the same business logic originating from a wireless device or web service for instance?

Your action classes should call your business logic/model - possibly through a business delegate, but your business model should not depend on http.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A Struts Action class is a controller component, not a model component. The primary controller object is the Struts ActionServlet, but the Action is still part of the controller space. Its function is to mediate between the model and the view. As Paul indicated, your business logic should go in separate objects that are then called by the Action.
 
reply
    Bookmark Topic Watch Topic
  • New Topic