aspose file tools*
The moose likes Struts and the fly likes when and when Not to use Struts. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "when and when Not to use Struts." Watch "when and when Not to use Struts." New topic
Author

when and when Not to use Struts.

Chris Harris
Ranch Hand

Joined: Sep 21, 2003
Posts: 231
Hi all,
I have no Struts experience but am comfortable with JSP and Servlets. My understanding of Struts is that it helps to provide a clear division of the web roles (web designer, component developer and the database developer). This is done by using actions.
Can someone tell me when is Struts is appropriate and more importantly when is it not.
Thanks
Chris.


SCJP 1.2, SCWCD, SCBCD
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Chris Harris:
Can someone tell me when is Struts is appropriate and more importantly when is it not.
In my opinion, Struts is most useful when your application contains a lot of form handling (i.e. if you're writing an application with machine-to-machine XML interfaces only, Struts won't be of that much help). Further, Struts does have some learning curve/overhead so for the most simple applications it might be more productive to write straight Servlet and JSP code instead of using Struts. It's close to impossible to say anything more specific, I think.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Ariel Valentin
Ranch Hand

Joined: Jan 30, 2004
Posts: 44
My understanding of Struts is that it helps to provide a clear division of the web roles (web designer, component developer and the database developer).

Sort of... Struts is based on a design pattern called the Model-View-Contoller "invented" and first used I believe by Smalltalk developers. Essentially there is a separation of the presentation layer (View) from the business logic(Model). The controllers responsibility is to monitor incoming requests and send them to the appropriate view. It most closly resembles the J2EE design pattern Front Controller design pattern.
It may not necessarily divide the tasks between the different roles, but it will make an HTML developers life easy not to have to see a ton of java scriplets in the source code while allowing a component developer to concentrate on business logic.
Hope that helps


A. Valentin
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: when and when Not to use Struts.