Struts 1.x vs Struts 2.x
Asked Answered
R

7

8

I have reviewed a few Struts 1 vs 2 questions on SO but none seem to answer the question in the perspective that I am looking at it with.

I am about to start work architecting a new system, a complete re-engineering of a very old desktop application. The goal is to make it web based, add more functionality, make it more usable etc (the usual reengineering reasons).

The team who will be developing the system are mainly Java developers and have worked on Struts 1.x extensively over the past 5 years.

The system is intended to live for many years to come, so the idea of re-engineering again in 3-5 years time when a better framework comes out is not an option. It is not intended to heavily use AJAX.

My question, is why would I bother moving to Struts 2 when my team are so experienced with Struts 1.x. I understand that there are some improvements, but I worry that the time lost in getting the team up to speed, rework due to incorrect usage etc will far outweigh any benefit we would get from Struts 2. We like Struts 1, it does what we need to it do, and all the design patterns, standards, best practices etc are in place.

Are there any killer features with Struts 2 or serious problems I don't know about in Struts 1 that would sway the decision to stay with Struts 1.

Rosariarosario answered 3/5, 2011 at 10:7 Comment(1)
I would be weary of using such an old framework to start a new project.Leprose
E
9

If you are building a system from scratch I would definitely move onto version 2.x of Struts. The learning curve will not be great for a Struts 1.x team, but you will be able to take advantage of an up-to-date MVC framework.

For me the two main features of Struts 2.x which will enhance productivity are:

  • Built in AJAX support
  • No more ActionForms - you can bind directly into Domain Objects if you want, so this intermediate step has gone.

If it's a big project you're working on, you might want to look at a component framework e.g. JSF 2 or Wicket. If you're determined to stay on an Action based framework then I personally find Stripes a more productive framework.

Effluence answered 3/5, 2011 at 10:55 Comment(0)
S
4

Struts 1.x is 2000 vintage technology. Why on earth would you even consider sticking with it on a brand-new app?

The biggest drawback that I can see is that Struts locks you into a JSP-based, browser UI. Struts Actions are reusable only within the framework. You'll have a hard time seamlessly integrating a mobile device into that system if you need to.

I'd start thinking about web services, preferrably REST-based, and AJAX. The world has changed. I'd look into alternatives to Struts, like Spring or Play. Picking up a new web framework wouldn't be that big a deal, but the benefits could be worth it.

Those employees that have done nothing but work with an outdated framework for the last five years will thank you, too. Time for new skills.

UPDATE: If you've tried, and can't be late, and too many constraints, then I'd say you already know your answer. What are you hoping to get by coming here? I don't see an argument that you've failed to think through.

Stolen answered 3/5, 2011 at 11:24 Comment(4)
I understand your point fully. But my concern is that I have been involved in projects where a new technology has been chosen (because it is more recent, and has x,y benefits) and due to lack of understanding of the framework, bad design decisions were made and the project was hugely late. I cannot allow this to happen on this project, so I am tempted to stay safe!....As for Spring/Play, I would love to use Play (I am the author of the Play book), but management are unlikely to buy-in to the framework being relatively young (I have tried already).Rosariarosario
+1 for the Struts 1 comments. Struts 2 is a good option, as is Play. I don't see the point of using Spring MVC unless you are using Spring DI/AOP, though.Leprose
Using Spring MVC is no worse than using Struts 1.x. And you don't have to use all the Spring machinery to benefit from parts of it. It works well a la carte, too.Stolen
My reason for coming here is that I have experience of Struts1, but not 2. I would need a good reason to move away from something the team knows well, so I wanted to see if there was a strong enough reason to make the change that offset the potential learning curve difficulties.Rosariarosario
B
2

Given that your have a team with good experience in Struts 1.x and your product is stable as well, I don't see a great reason to migrate to Struts 2. Apache too seem to agree that http://struts.apache.org/roadmap.html#migrate_s1.

Bennett answered 3/5, 2011 at 10:36 Comment(0)
C
1

I'd think instead of asking "Stick with Struts1 or move to Struts2?" you'd better ask "Stick with Struts1 or move to a modern action based MVC web framework?". Why to move ? Because Struts1 is old and (frankly) sucks. Why not to move? Because we must learn a new framework. Granted, you know your resources, you must do the evaluation. But bear in mind that modern action based frameworks (Struts2, SpringMVC, Stripes) are quite easy to learn, and more so if your teams already knows Struts1.

Myself, I've have migrated from Struts to Struts2 and now I wouldn't like to return to Struts1 programming (those clumsy ActionForms!). I think Struts2 is much better. But one must also consider that Struts2 has also its weak points, the project does not seem very healty and the community does not seem very active. The jump from Struts1 to Struts2 is not big, but is not as small as a version change ("Struts2" is a misnomer), and it is probably not smaller that the jump to SpringMVC, so I'd suggest to consider it (or Stripes).

Cella answered 4/5, 2011 at 14:41 Comment(0)
B
0

More Generally, Struts 2.x layered framework compare to Struts 1.x. For example in data layer , Struts 2.x has DO layer between VO and DAO.. Similarly other features are mentioned in the below link..

http://struts.fromdev.com/2008/08/struts-1-vs-struts-2.html ..

Since your team has more experienced with struts 1.x , i don't think it will take more time to migrate your code in to struts 2.x.

Please be specific what kind of difference u are expecting..

Blaineblainey answered 3/5, 2011 at 10:28 Comment(0)
E
0

in struts2.0 there are more feature and advantage , in struts2.0 there is no form beam, a good and power full validation framework and most imported in struts2.0 for every request there is one instance of action but in sturts1.x only one instance of action for hole application.

so choice is yours . :)

Ellett answered 3/5, 2011 at 10:50 Comment(0)
M
0

Well the main reason is moving to struts 2.x in place of struts 1.x is struts 1.x is in maintenance phase now not in much active development.

now when it starts with a team who have good understanding of struts 1.x is that they will get the underlying system quickly.but before let me to put one point in a clear manner. struts1.x has no similarity with struts 2.x the only similarity is the name inherited from the parents. struts2 has following advantages.

  1. Action based framework
  2. A strong Ajax support
  3. Interceptors approach (core of framework) 4 Decoupled from the Serve let API which means plain POJO so unit testing will be much much easier

but my point is simple struts2 and struts1 only similar in terms of name but in terms of underlying architecture they are quite different.

Mcduffie answered 4/5, 2011 at 4:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.