• 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

action objects

 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are action objects of struts model or controller.
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess that depends to a certain extent on what you do in your actions. I guess they could be considered either. If you use them to simply invoke a session facade in your distributed application, I would consider them part of the controller.
Whereas if you start maniuplating your object model and accessing the RDBMS you could say that the action is part of the model.
It is probably cleaner to consider them part of the controller and implement the business logic elsewhere where reuse is more likely.
Jesse
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pradeep,
the Struts Actions form definitively the Controller part. It is technically possible to add Model logic in the Action. But as Jesse mentioned, it is advaisable to avoid to do so!
Regards
Berny Woehrlin
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is possible to have your Actions work as part of the model, but that is considered poor design. Struts is a model neutral framework and the Actions are supposed to be extensions of the controller.
 
Author
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personally, I consider everything in the Action package (and Config package in 1.1) to be part of the control layer, including the ActionForms.
The Action is designed to provide a bridge between the presentation layer (JSPs, templates, XMLs) and the model layer. The idea is that the view layer can talk to the Action and the Action then talks to the model layer.
Ideally, the Action should be talking to a facade that condenses what it needs to know about the model layer. For example, anything involving JDBC should be behind a facade. The Action passes the required inputs to the facade, and then relays the output to the view.
HTH, Ted.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic