Seam比Spring有什么优点/缺点?

时间:2021-12-07 20:00:15

What are the advantages/disadvantages of Seam over Spring? Why would I use Seam in lieu of Spring?

Seam比Spring有什么优点/缺点?为什么我会使用Seam代替Spring?

Is there anything that can be done in Seam that can't be done in Spring? Anything in Spring that can't be done in Seam?

在Seam中有什么可以在Spring中完成的吗? Spring中的任何东西都无法在Seam中完成?

What about stateful/stateless architecture? I am a Spring user, so I am biased, naturally.

有状态/无状态架构怎么样?我是Spring用户,所以我很自然。

5 个解决方案

#1


Why Spring?

  • Cleaner code
  • Streamlined application configuration
  • 简化的应用程序配置

  • Nice integration with popular open source products
  • 与流行的开源产品很好地集成

  • First class AOP support
  • 一流的AOP支持

  • Enterprise-scale security: Acegi
  • 企业级安全:Acegi

  • Highly flexible MVC
  • 高度灵活的MVC

  • Abstracted data access (JDBC is OK)
  • 抽象数据访问(JDBC可以)

  • Enterprise Java without EJB
  • 没有EJB的企业Java

  • Testing is easy
  • 测试很简单

Why Seam?

  • Merge Java EE 5 standards (EJB 3.0, JPA, JSF, Annotation) seamlessly
  • 无缝地合并Java EE 5标准(EJB 3.0,JPA,JSF,Annotation)

  • Stateful by design
  • 有状态的设计

  • Bijection
  • Integrated Ajax (ICEfaces and Ajax4JSF)
  • 集成的Ajax(ICEfaces和Ajax4JSF)

  • Business process integration (jBPM)
  • 业务流程集成(jBPM)

  • Business rules integration (Drools)
  • 业务规则集成(Drools)

  • Workspace management
  • Deliver complete stack (from JBoss & RedHat)
  • 提供完整的堆栈(来自JBoss和RedHat)

  • Seam Text and EL enhancements
  • Seam Text和EL增强功能

  • Probably will be a standard (JSR-299: Web Beans)
  • 可能是标准(JSR-299:Web Beans)

From Framework Deathmatch: Spring vs Seam. Thomas Wiradikusuma (Spring). Joshua Jackson (Seam). Java User Group Indonesia. JaMU 07.03. March 17, 2007 power point presentation here

来自Framework Deathmatch:Spring vs Seam。托马斯Wiradikusuma(春天)。约书亚杰克逊(Seam)。 Java用户组印度尼西亚。 JaMU 07.03。 2007年3月17日的电源点介绍在这里

#2


although seam does have many advantages over spring, there is a magic word that really is worth paying attention to and this is PERFORMANCE!!! if you are not worried about performance issues I would go with seam. From the other hand if you want your application to be as fast as possible and your hardware is limited I would use spring. I am not saying that you can not develop fast applications with seam, but in order to do this you really need to know what you are doing. I have used both of them (i am not a guru in any of them) and what I found out is that although spring needs more effort to build what you want, at the end the result is more flexible and is performing better. I do not think that there is something that can be done in one framework that it can not be done in the other, saying that, remember that I am not an expert to any of those.

虽然接缝确实比春天有许多优点,但有一个神奇的词真的值得关注,这就是性能!如果你不担心性能问题,我会选择接缝。另一方面,如果您希望您的应用程序尽可能快,并且您的硬件有限,我会使用spring。我不是说你不能用接缝开发快速应用程序,但为了做到这一点,你真的需要知道你在做什么。我已经使用了它们(我不是其中任何一个的大师)而我发现的是,尽管spring需要更多努力来构建你想要的东西,但最终结果更灵活,性能更好。我不认为在一个框架中可以做到的事情在另一个框架中无法完成,并且说,请记住,我不是任何一个的专家。

#3


Seam will give you a pretty, ah, seamless, integration between the components that make up the seam stack. All very nice as long you keep within that stack, and within the seam model and foing things. It all starts to look a little less convincing as soon as you start doing something unusual, though.

Seam将为组成接缝堆叠的组件之间提供漂亮,无缝的集成。只要你保持在堆叠内,并在接缝模型和foing事物内,所有都非常好。一旦你开始做一些与众不同的事情,这一切都开始变得不那么令人信服了。

If it's not too much of a generalisation, Seam is very "microsofty" in that regard. This isn't a bad thing, it's just a stylistic thing. Spring is more open-ended and takes more effort to get going, but it's ultimately more flexible, and a lot more open.

如果不是一般化,那么Seam在这方面是非常“微观”的。这不是一件坏事,它只是一种风格。 Spring更开放,需要更多的努力才能开始,但它最终更灵活,更开放。

#4


You can use Spring and Seam together - Spring for backend components, Seam for enhancement of web layer (JSF/GWT/Wicket) and other stuff. Seam offers a lot of Spring functionality (i.e. IoC container, transaction managment) - in your project you can decide - witch implementation to use. More details on integrating Seam with Spring - "Seam in Action - free bonus chapter"

你可以一起使用Spring和Seam - Spring用于后端组件,Seam用于增强web层(JSF / GWT / Wicket)和其他东西。 Seam提供了很多Spring功能(即IoC容器,事务管理) - 在你的项目中你可以决定使用。关于将Seam与Spring集成的更多细节 - “Seam in Action - 免费奖励章节”

#5


Let's compare the two.

让我们比较两者。

What is common?

什么是常见的?

Both are open source, follow MVC architecture and has a servlet based front controller.

两者都是开源的,遵循MVC架构并且具有基于servlet的前端控制器。

Advantages of Spring MVC

Spring MVC的优点

  • Extension of Struts.
  • Struts的扩展。

  • View can be developed using JSP and HTML. You can also plugin other's like PHP or velocity.
  • 可以使用JSP和HTML开发视图。您还可以插入其他类似PHP或速度的插件。

  • Has large number of controllers predefined.
  • 预定义了大量控制器。

  • Integrated out of the box with Spring framework.
  • 与Spring框架一起开箱即用。

Advantages of Seam

Seam的优点

  • Extension of JSF
  • JSF的扩展

  • View can be developed using JSF component library. There are large number of vendors to choose from.
  • 可以使用JSF组件库开发View。有大量供应商可供选择。

  • Integrates JPA entities with Web layer
  • 将JPA实体与Web层集成

  • Annotation based validation
  • 基于注释的验证

  • Integrates with EJB 3.0
  • 与EJB 3.0集成

  • Out the box jBPM support which provides process flow definitions.
  • jBPM支持框提供了流程定义。

  • Integrates with Drools where you can define web layer business rules.
  • 与Drools集成,您可以在其中定义Web层业务规则。

  • Good community support.
  • 良好的社区支持。

Conclusion

Since Seam is built on JSF, it has large number of UI Component libraries to pick from. It reuses Java EE stack better. It has lot of interesting modules integrated beforehand.

由于Seam是基于JSF构建的,因此它具有大量可供选择的UI组件库。它更好地重用了Java EE堆栈。它预先集成了许多有趣的模块。

Spring MVC is built on top of Struts and Spring, so it will reuse Spring framework stack far better than others. But the view is built using JSP, so we have to rely on JSP tag library vendors to build rich components.

Spring MVC建立在Struts和Spring之上,因此它将比其他更好地重用Spring框架堆栈。但是视图是使用JSP构建的,因此我们必须依靠JSP标记库供应商来构建丰富的组件。

Seam framework would be a better choice as Spring framework is anyway extensible enough to be leveraged by Seam.

Seam框架将是一个更好的选择,因为Spring框架无论如何都可以扩展到足以被Seam利用。

#1


Why Spring?

  • Cleaner code
  • Streamlined application configuration
  • 简化的应用程序配置

  • Nice integration with popular open source products
  • 与流行的开源产品很好地集成

  • First class AOP support
  • 一流的AOP支持

  • Enterprise-scale security: Acegi
  • 企业级安全:Acegi

  • Highly flexible MVC
  • 高度灵活的MVC

  • Abstracted data access (JDBC is OK)
  • 抽象数据访问(JDBC可以)

  • Enterprise Java without EJB
  • 没有EJB的企业Java

  • Testing is easy
  • 测试很简单

Why Seam?

  • Merge Java EE 5 standards (EJB 3.0, JPA, JSF, Annotation) seamlessly
  • 无缝地合并Java EE 5标准(EJB 3.0,JPA,JSF,Annotation)

  • Stateful by design
  • 有状态的设计

  • Bijection
  • Integrated Ajax (ICEfaces and Ajax4JSF)
  • 集成的Ajax(ICEfaces和Ajax4JSF)

  • Business process integration (jBPM)
  • 业务流程集成(jBPM)

  • Business rules integration (Drools)
  • 业务规则集成(Drools)

  • Workspace management
  • Deliver complete stack (from JBoss & RedHat)
  • 提供完整的堆栈(来自JBoss和RedHat)

  • Seam Text and EL enhancements
  • Seam Text和EL增强功能

  • Probably will be a standard (JSR-299: Web Beans)
  • 可能是标准(JSR-299:Web Beans)

From Framework Deathmatch: Spring vs Seam. Thomas Wiradikusuma (Spring). Joshua Jackson (Seam). Java User Group Indonesia. JaMU 07.03. March 17, 2007 power point presentation here

来自Framework Deathmatch:Spring vs Seam。托马斯Wiradikusuma(春天)。约书亚杰克逊(Seam)。 Java用户组印度尼西亚。 JaMU 07.03。 2007年3月17日的电源点介绍在这里

#2


although seam does have many advantages over spring, there is a magic word that really is worth paying attention to and this is PERFORMANCE!!! if you are not worried about performance issues I would go with seam. From the other hand if you want your application to be as fast as possible and your hardware is limited I would use spring. I am not saying that you can not develop fast applications with seam, but in order to do this you really need to know what you are doing. I have used both of them (i am not a guru in any of them) and what I found out is that although spring needs more effort to build what you want, at the end the result is more flexible and is performing better. I do not think that there is something that can be done in one framework that it can not be done in the other, saying that, remember that I am not an expert to any of those.

虽然接缝确实比春天有许多优点,但有一个神奇的词真的值得关注,这就是性能!如果你不担心性能问题,我会选择接缝。另一方面,如果您希望您的应用程序尽可能快,并且您的硬件有限,我会使用spring。我不是说你不能用接缝开发快速应用程序,但为了做到这一点,你真的需要知道你在做什么。我已经使用了它们(我不是其中任何一个的大师)而我发现的是,尽管spring需要更多努力来构建你想要的东西,但最终结果更灵活,性能更好。我不认为在一个框架中可以做到的事情在另一个框架中无法完成,并且说,请记住,我不是任何一个的专家。

#3


Seam will give you a pretty, ah, seamless, integration between the components that make up the seam stack. All very nice as long you keep within that stack, and within the seam model and foing things. It all starts to look a little less convincing as soon as you start doing something unusual, though.

Seam将为组成接缝堆叠的组件之间提供漂亮,无缝的集成。只要你保持在堆叠内,并在接缝模型和foing事物内,所有都非常好。一旦你开始做一些与众不同的事情,这一切都开始变得不那么令人信服了。

If it's not too much of a generalisation, Seam is very "microsofty" in that regard. This isn't a bad thing, it's just a stylistic thing. Spring is more open-ended and takes more effort to get going, but it's ultimately more flexible, and a lot more open.

如果不是一般化,那么Seam在这方面是非常“微观”的。这不是一件坏事,它只是一种风格。 Spring更开放,需要更多的努力才能开始,但它最终更灵活,更开放。

#4


You can use Spring and Seam together - Spring for backend components, Seam for enhancement of web layer (JSF/GWT/Wicket) and other stuff. Seam offers a lot of Spring functionality (i.e. IoC container, transaction managment) - in your project you can decide - witch implementation to use. More details on integrating Seam with Spring - "Seam in Action - free bonus chapter"

你可以一起使用Spring和Seam - Spring用于后端组件,Seam用于增强web层(JSF / GWT / Wicket)和其他东西。 Seam提供了很多Spring功能(即IoC容器,事务管理) - 在你的项目中你可以决定使用。关于将Seam与Spring集成的更多细节 - “Seam in Action - 免费奖励章节”

#5


Let's compare the two.

让我们比较两者。

What is common?

什么是常见的?

Both are open source, follow MVC architecture and has a servlet based front controller.

两者都是开源的,遵循MVC架构并且具有基于servlet的前端控制器。

Advantages of Spring MVC

Spring MVC的优点

  • Extension of Struts.
  • Struts的扩展。

  • View can be developed using JSP and HTML. You can also plugin other's like PHP or velocity.
  • 可以使用JSP和HTML开发视图。您还可以插入其他类似PHP或速度的插件。

  • Has large number of controllers predefined.
  • 预定义了大量控制器。

  • Integrated out of the box with Spring framework.
  • 与Spring框架一起开箱即用。

Advantages of Seam

Seam的优点

  • Extension of JSF
  • JSF的扩展

  • View can be developed using JSF component library. There are large number of vendors to choose from.
  • 可以使用JSF组件库开发View。有大量供应商可供选择。

  • Integrates JPA entities with Web layer
  • 将JPA实体与Web层集成

  • Annotation based validation
  • 基于注释的验证

  • Integrates with EJB 3.0
  • 与EJB 3.0集成

  • Out the box jBPM support which provides process flow definitions.
  • jBPM支持框提供了流程定义。

  • Integrates with Drools where you can define web layer business rules.
  • 与Drools集成,您可以在其中定义Web层业务规则。

  • Good community support.
  • 良好的社区支持。

Conclusion

Since Seam is built on JSF, it has large number of UI Component libraries to pick from. It reuses Java EE stack better. It has lot of interesting modules integrated beforehand.

由于Seam是基于JSF构建的,因此它具有大量可供选择的UI组件库。它更好地重用了Java EE堆栈。它预先集成了许多有趣的模块。

Spring MVC is built on top of Struts and Spring, so it will reuse Spring framework stack far better than others. But the view is built using JSP, so we have to rely on JSP tag library vendors to build rich components.

Spring MVC建立在Struts和Spring之上,因此它将比其他更好地重用Spring框架堆栈。但是视图是使用JSP构建的,因此我们必须依靠JSP标记库供应商来构建丰富的组件。

Seam framework would be a better choice as Spring framework is anyway extensible enough to be leveraged by Seam.

Seam框架将是一个更好的选择,因为Spring框架无论如何都可以扩展到足以被Seam利用。