File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes A simple question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "A simple question" Watch "A simple question" New topic

A simple question

Mohan Panigrahi
Ranch Hand

Joined: Sep 28, 2001
Posts: 142
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?

Paul Strachan

Joined: Oct 24, 2004
Posts: 10
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.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.

Consultant, Sima Solutions
I agree. Here's the link:
subject: A simple question
It's not a secret anymore!