3

Scenario: A fairly mature project uses Struts2 and Spring and Hibernate. I say mature because it has been going on a for a while and there are many struts actions written already.

Suppose we wanted to remove Struts2 from the project and instead depend entirely on Spring MVC without rewriting the entire project.

Is this something that should even be considered? Are there any migration guides out there? Has anyone done this before and would like to warn me against it?

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
Vincent Ramdhanie
  • 102,349
  • 23
  • 137
  • 192
  • Can you migrate the project one part at a time? How tightly coupled is your application? – Dean J May 21 '10 at 15:41
  • @Dean J I probably could do it in parts, but the bigger question of if we should consider in the first place still hangs over my head. – Vincent Ramdhanie May 21 '10 at 16:15
  • I have no experience with Spring MVC, but I see it too similar in aproach (and relative strenghs and shortcomings) to Struts2 to justify such migration effort. – leonbloy May 21 '10 at 16:43
  • How much of the work left on the system is building new pages, and how much work is maintaining pages that already exist? I'm going to have to agree (and +1!) Pascal's answer below; if you have trouble justifying the migration compared to other projects you could spend the time on, don't migrate. – Dean J May 24 '10 at 13:09

4 Answers4

9

If it ain't broke, don't fix it. You have very likely better things to do than a migration that won't add any value to the product (and will certainly introduce some bugs). If I were the business, I would never buy such a migration (with close to zero benefits).

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
1

With Struts2 security vulnerabilities being exposed and reported often, this task takes on more importance.

1

You can do it slowly. Struts is a MVC framework. The rest of your application (business and data tiers) are classes which can be invoked by action classes. Struts is a plugin based architecture and it is easy for you to define a plugin in struts configuration file.

Take a look at this link. This may help.

Kartik
  • 2,541
  • 2
  • 37
  • 59
1

I have to ask: What advantages do you see with Spring MVC that aren't being fulfilled by Struts 2?
If there's not at least a handful of "smoking hot" features, or the amount of time saved is more than enough to overcome the time taken for the migration in the first place then it's probably best to stick with what you have.

Ryan P.
  • 855
  • 2
  • 14
  • 20
  • 1
    It is really a hypothetical question. I think that you are right, we can do everything with Struts2 and we are actually using spring for dependency injection already. I just wondered if it was necessary to use both or better off removing struts and using just Spring. – Vincent Ramdhanie May 22 '10 at 05:39
  • I understand your curiosity, I had a project awhile back on Struts-2 I also would wonder sometimes if a different framework would make easier/more elegant/fun. :-) It might be worthwhile to maybe create a branch and spend a couple hours moving over one small subset to see how it turns out. Worst case is you'll get some more familiarity with Spring MVC. – Ryan P. May 22 '10 at 15:26