Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which is better Struts 2.0 vs Spring and Why

 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can any one tell me Which framework is better Struts 2.0 vs Spring and Why.

In which condition both usefull and how to use.

now I am working on Struts 2.0 + hibernate . My point of view Struts 2.0 is easy to understand and rapid development framework compare to Spring.

please guide me.

Thanks In Advanced
Nishan
 
Rogerio Kioshi
Ranch Hand
Posts: 690
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it depends of your requirements. If you are satisfied with Struts 2, why don't you keep with it? Why changing to something new if your requirements are satisfied with your current framework?
Many times we have the feeling that some other framework is better than the one we are using, but we must consider all the effort we should spend if we wanna change our application to other technology.
 
Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have not used struts 2.0 but I used 1.x versions.

I have moved to Spring after that. But in my opinion, we should move on to Spring as it has more than MVC to do.

Struts is not an alternate to the EJBs where as Spring is an alternate.

Some one can correct me if I am wrong.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts is not an alternate to the EJBs where as Spring is an alternate.


Spring is still a MVC-based Presentation framework. It is not an alternative to Enterprise JavaBeans. Spring has more support to working with Model code, Struts has none.

The supporting Spring code for the Model is not an alternative to a business object model. These are only supporting objects that help you integrate your business object model with your presentation code.

A Spring-based web application should connect to a POJO or EJB-based business model application in order to execute business logic. If business logic is coded in any of the Spring objects, then the Spring framework is being used incorrectly.

Spring is favored over Struts because of these supporting objects that help integrate the presentation component with the business component.

However, Spring does not present a framework for implementing business/domain logic. It helps you create a Controller and a View for your application, no Model though. EJB is still a great option for implementing the business/domain object model.
[ October 08, 2008: Message edited by: James Clark ]
 
Alaa Nassef
Ranch Hand
Posts: 471
Hibernate Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We should standardize our definitions first. Spring is a fully fledged application framework, that has a large stack of sub projects. One of the projects is spring MVC, which is a web framework and certainly better than struts 1.x in every way. As for struts 2, which is based on web work, it's also a great solution, and has its advantages over spring MVC (and disadvantages as well).

As for spring, if we look at its history, it started as an effort for supplying a solution for enterprise java applications, and to replace EJBs (while it also provided integration with EJBs for people who didn't want to ditch that). Spring is much more than an MVC framework. It provides dependency injection, AOP, integration with almost every known framework, a security framework (a separate sub-project), and a lot of other stuff. Struts 2 and hibernate integrate easily with spring, so you might like to add it to your stack, without ditching struts 2
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic