简体   繁体   English

用Spring MVC替换Struts2

[英]Replacing Struts2 with spring mvc

I've seen plenty of questions about the difference between Struts2 and Spring MVC. 我已经看到了很多关于Struts2和Spring MVC之间的区别的问题。 But my question is the following: 但是我的问题是:

I have a large-scale web app that needs reworking and its based on Struts2. 我有一个需要重新设计的大型Web应用程序,它基于Struts2。 What I want to do is integrate Hibernate + Spring + Spring Security + Potentially Spring DM ( since we want to make it as modular as possible). 我要做的是集成Hibernate + Spring + Spring Security +潜在的Spring DM(因为我们希望使其尽可能模块化)。

Now as you can see its already a lot of reworking, so I am wondering IF in case I leave Struts2 (to reduce a tiny bit my rework) would this cause a significant perfromance issue in the future? 现在,您可以看到它已经进行了大量的返工,所以我想知道如果我离开Struts2(以减少一点返工)的话,这会在将来引起重大的性能问题吗?

My question is mainly a continuation the question asked by others before. 我的问题主要是其他人之前提出的问题的延续。 However what I am interested in is not if its possible, more like what would cost in terms of performance if I keep Struts2. 但是,我感兴趣的不是,如果有可能,更像是保留Struts2会对性能造成的影响。

Thanks, 谢谢,

I don't see "performance" as a key factor in the decision of replacing Struts2 with Spring MVC. 我不认为“性能”是决定用Spring MVC替换Struts2的关键因素。

If your application currently has performance issues, I doubt that the core Web framework being used (Struts2 or Spring MVC) are the cause of it. 如果您的应用程序当前存在性能问题,那么我怀疑所使用的核心Web框架(Struts2或Spring MVC)是其原因。

Most likely it's going to be the usage of the framework, or something unrelated to it (backend processing, database queries,....). 最有可能是框架的使用或与框架无关的内容(后端处理,数据库查询等)。

If your application doesn't have performance issues, replacing a technical component like Struts with Spring MVC will not influence it. 如果您的应用程序不存在性能问题,那么用Spring MVC替换Struts等技术组件不会对其产生影响。 Neither frameworks have major issues and are used in production environments without known performance issues. 这两个框架都没有重大问题,并且可以在没有已知性能问题的生产环境中使用。

The decision to switching to another framework should be based on other factors (support model, community support, functionalities offered by the framework, strategic architectural alignment,....) 切换到另一个框架的决定应基于其他因素(支持模型,社区支持,框架提供的功能,战略架构调整等)。

My advice: If the application is not broken, don't fix it . 我的建议: 如果应用程序未损坏,请不要对其进行修复 Look at the cost to replace Struts2 to Spring MVC and the benefits (include the revenue generation too). 查看将Struts2替换为Spring MVC的成本以及收益(也包括创收)。 If the ROI is less than expenses, then don't do it. 如果投资回报率小于支出,那就不要这样做。

I don't think that can be answered without making performance test and profiling, because any performance bottlenecks would likely be in your use of the frameworks rather then in the frameworks themselves. 我认为如果不进行性能测试和性能分析就无法解决这个问题,因为任何性能瓶颈都可能在您使用框架而不是框架本身中。

I'd strongly recommend testing before making estimations about the performance. 在评估性能之前,我强烈建议您进行测试。

Also if you're going to switch to Spring MVC only on performance grounds my advice would be: don't do it. 另外,如果您仅出于性能考虑而切换到Spring MVC,我的建议是:不要这样做。

Modular? 模块化的? Really? 真? You mean your S2 app isn't crafted that way? 您是说您的S2应用不是这样制作的? You can leverage Spring for DI purposes and take a look a the OSGI plug-in. 您可以将Spring用于DI的目的,并查看OSGI插件。 Rewriting your app to use Spring MVC is waste of your IT dollars IMO. 重写应用程序以使用Spring MVC会浪费您的IT成本IMO。 Good luck. 祝好运。 @jeffblack360 @ jeffblack360

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM