This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Pattern used by action class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Pattern used by action class?" Watch "Pattern used by action class?" New topic
Author

Pattern used by action class?

Chandra shekar M
Ranch Hand

Joined: Dec 20, 2006
Posts: 135
Hi,

In struts 1.x the execute(ActionForm form,ActionMapping map,Htt...) as this signature. When the request is originated the struts framework will use reflectionAPI concept and populate the form bean then the request if forwarded to Action class for processing now the execute method has form bean object passed. Passing of the form object is it based on command pattern? or any other pattern?


I guess its Command pattern; similar functionality is provided by the spring where we actually set the command object(formbean) using setCommand(ActionForm). Please correct me if i am wrong.

Thanks
Chandra
Chandra shekar M
Ranch Hand

Joined: Dec 20, 2006
Posts: 135
Any updates on this.

Thanks
Chandra
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Well, first thing is where does the Action class fit in M'VC' pattern, which is always debatable and out of scope for now.
To me, Undoubtedly ActionServlet is front controller pattern.
If you say that "Action Class" is part of Controller then,
To me, I see Struts Action class to follow more of "Service to Worker pattern" wherein using "struts-config" is "Command pattern" and using Tiles is "Composite View pattern". This is due to action class which does little bit more to call the business layer (if any) and other business logic for validations etc.
If you say that Actions is part of View then,
To me, I see Struts Action class to follow more of "Dispatching View pattern". Since here, action class is still responsible to receive the request and process it provide the response with less amount of business logic processing.

Again, this is my perspective any objections are welcomed

Have Fun with Java
little,little.. little by little makes a lot..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pattern used by action class?
 
Similar Threads
Architecturally correct and the best way to access EJB from a JSP client(urgent!!)
ActionForm (Context Object Or Command pattern?)
Domain Object as Strtus Action form.
Action Form Problem
Command & Context Object pattern