« Awesome! | Main | The 101 Dumbest... »

Actions part of Controller or Model?

[Struts] developers have a differing opinion on whether the Action class is part of the controller or the model. The argument for it being part of the controller is that it isn’t part of the “real” business logic. If Struts were replaced with an alternative framework, chances are the Action class would be replaced with something else. Therefore, it really isn’t part of the model domain, but rather tightly coupled to the Struts controller. It doesn’t make sense to put business logic into the Action, since other types of clients can’t easily reuse it. From Chapter 3 in the Server Side's Jakarta Struts Book Review Project
In the alternative framework WebWork, the action classes could be considered to be part of the model because they include no presentation specific code (i.e. no Servlet API calls). Some would argue that this is better and allows re-use of actions, but I think it is just different. For Roller, the WebWork approach really does not buy me much - my 'business logic' is already re-usable and encapsulated in my model interfaces and classes.
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

« Awesome! | Main | The 101 Dumbest... »

Welcome

This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog

Related entries

Below are the most recent entries in the category Roller, some may be related to this entry.