Struts 1.x 与 Struts 2.x

发布于 2024-11-05 05:45:00 字数 541 浏览 3 评论 0原文

我已经回顾了一些关于 SO 的 Struts 1 vs 2 问题,但似乎没有一个能从我正在看待的角度回答这个问题。

我即将开始构建一个新系统,对一个非常旧的桌面应用程序进行彻底的重新设计。目标是使其基于网络,添加更多功能,使其更可用等(通常的重新设计原因)。

开发该系统的团队主要是 Java 开发人员,在过去 5 年里广泛致力于 Struts 1.x 的开发。

该系统的设计目的是在未来的许多年里都可以使用,因此在 3 到 5 年内出现更好的框架时再次重新设计的想法是不可行的。它无意大量使用 AJAX。

我的问题是,当我的团队在 Struts 1.x 方面经验丰富时,为什么我还要费心迁移到 Struts 2。我知道有一些改进,但我担心让团队加快速度所损失的时间、由于不正确的使用而导致的返工等将远远超过我们从 Struts 2 中获得的任何好处。我们喜欢 Struts 1,它做了我们想要的事情需要它这样做,并且所有设计模式、标准、最佳实践等都已就位。

Struts 2 中是否有任何杀手级功能或 Struts 1 中我不知道的严重问题会影响我继续使用 Struts 1 的决定。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

新一帅帅 2024-11-12 05:45:00

如果您从头开始构建一个系统,我肯定会转向 Struts 2.x 版本。对于 Struts 1.x 团队来说,学习曲线不会很好,但您将能够利用最新的 MVC 框架。

对我来说,Struts 2.x 的两个主要功能将提高工作效率:

  • 内置 AJAX 支持
  • 不再有 ActionForm - 如果需要,您可以直接绑定到域对象,因此这个中间步骤已经消失。

如果您正在处理一个大型项目,您可能需要查看组件框架,例如 JSF 2 或 Wicket。如果您决定继续使用基于 Action 的框架,那么我个人认为 Stripes 是一个更高效的框架。

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.

白芷 2024-11-12 05:45:00

Struts 1.x 是 2000 年的老式技术。您究竟为什么会考虑在全新的应用程序上坚持使用它?

我发现的最大缺点是 Struts 将您锁定在基于 JSP 的浏览器 UI 中。 Struts Actions 只能在框架内重用。如果需要,您将很难将移动设备无缝集成到该系统中。

我开始考虑 Web 服务,最好是基于 REST 的服务和 AJAX。世界已经改变。我会研究 Struts 的替代品,比如 Spring 或 Play。选择一个新的 Web 框架并不是什么大不了的事,但它带来的好处是值得的。

那些过去五年除了使用过时的框架之外什么也没做的员工也会感谢您。是时候学习新技能了。

更新:如果您已经尝试过,并且不能迟到,并且有太多限制,那么我想说您已经知道答案了。你来这里希望得到什么?我认为没有一个论点是你没有经过深思熟虑的。

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.

平定天下 2024-11-12 05:45:00

鉴于您的团队在 Struts 1.x 方面拥有丰富的经验,并且您的产品也很稳定,我认为没有充分的理由迁移到 Struts 2。Apache 似乎也同意 http://struts.apache.org/roadmap.html#migrate_s1

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.

浅唱ヾ落雨殇 2024-11-12 05:45:00

我认为不要问“坚持使用 Struts1 还是转向 Struts2?”你最好问“坚持使用 Struts1 还是转向基于现代操作的 MVC Web 框架?”。为什么要搬家?因为 Struts1 很旧而且(坦白说)很糟糕。为什么不动呢?因为我们必须学习一个新的框架。当然,您了解自己的资源,因此必须进行评估。但请记住,基于现代动作的框架(Struts2、SpringMVC、Stripes)非常容易学习,如果您的团队已经了解 Struts1,则更容易学习。

我自己已经从 Struts 迁移到 Struts2,现在我不想再回到 Struts1 编程(那些笨拙的 ActionForms!)。我认为Struts2要好得多。但也必须考虑到Struts2也有它的弱点,项目看起来不太健康,社区看起来也不是很活跃。
从 Struts1 到 Struts2 的跳跃并不大,但也不像版本更改那么小(“Struts2”是一个用词不当),而且可能也不比到 SpringMVC 的跳跃小,所以我建议考虑它(或者条纹)。

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).

叫思念不要吵 2024-11-12 05:45:00

更一般地说,Struts 2.x 分层框架与 Struts 1.x 相比。例如在数据层中,Struts 2.x 在 VO 和 DAO 之间有 DO 层。类似的其他功能在下面的链接中提到。

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

自从你团队对 struts 1.x 更有经验,我认为将代码迁移到 struts 2.x 不会花费更多时间。

请具体说明您期望什么样的差异。

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..

来日方长 2024-11-12 05:45:00

在struts2.0中有更多的功能和优点,在struts2.0中没有form beam,
一个良好且强大的完整验证框架,大多数在 struts2.0 中导入,对于每个请求都有一个操作实例,但在 Sturts1.x 中只有一个针对孔应用程序的操作实例。

所以选择是你的。 :)

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 . :)

枫以 2024-11-12 05:45:00

迁移到 struts 2.x 代替 struts 1.x 的主要原因是
struts 1.x 正处于维护阶段,现在还没有进行太多积极的开发。

现在,当一个团队对struts 1.x有很好的理解时,他们会很快掌握底层系统。但在此之前,让我先明确指出一点。
struts1.x 与 struts 2.x 没有相似之处,唯一的相似之处是从父母那里继承的名称。
struts2具有以下优点。

  1. 基于操作的框架
  2. 强大的 Ajax 支持
  3. 拦截器方法(框架的核心)
    4 与 Serve let API 解耦,这意味着简单的 POJO,因此单元测试会容易得多,

但我的观点很简单 struts2 和 struts1 只是在名称方面相似,但在底层架构方面它们却截然不同。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文