Spring、Struts、Hibernate、JavaServer Faces、Tapestry 有什么区别?

2022-01-16 00:00:00 frameworks jakarta-ee java

请问有什么区别:-

  1. 春天
  2. 支柱
  3. Struts 2
  4. 休眠
  5. JavaServer Faces
  6. JavaServer 页面
  7. 挂毯

这些技术/框架是否相互补充?或者它们是彼此的替代品(在我使用其中一个之后,我就不需要使用另一个了)?

Are these technologies/framework complementary to each other? Or they are alternatives to each other (after I use one of them, then I don't need to use the other)?

谢谢.

推荐答案

  1. Spring 是一个 IoC 容器(至少是 Spring 的核心),用于使用依赖注入来连接事物.Spring 提供额外的服务,例如事务管理和各种其他技术的无缝集成.
  2. Struts 是一个基于动作的表示框架(但不要将其用于新开发).
  3. Struts 2 是一个基于动作的表示框架,即上述版本 2(由 WebWork 与 Struts 合并而成).
  4. Hibernate 是一种对象关系映射工具,一种持久性框架.
  5. JavaServer Faces 是基于组件的表示框架.
  6. JavaServer Pages 是所有提到的视图表示框架都使用的一种视图技术.
  7. Tapestry 是另一个基于组件的表示框架.
  1. Spring is an IoC container (at least the core of Spring) and is used to wire things using dependency injection. Spring provides additional services like transaction management and seamless integration of various other technologies.
  2. Struts is an action-based presentation framework (but don't use it for a new development).
  3. Struts 2 is an action-based presentation framework, the version 2 of the above (created from a merge of WebWork with Struts).
  4. Hibernate is an object-relational mapping tool, a persistence framework.
  5. JavaServer Faces is component-based presentation framework.
  6. JavaServer Pages is a view technology used by all mentioned presentation framework for the view.
  7. Tapestry is another component-based presentation framework.

所以,总结一下:

  • Struts 2、JSF、Tapestry(以及 Wicket、Spring MVC、Stripes)是表示框架.如果您使用其中一个,就不要使用另一个.
  • Hibernate 是一个持久化框架,用于将 Java 对象持久化到关系数据库中.
  • Spring 可用于将所有这些连接在一起并提供声明式事务管理.
  • Struts 2, JSF, Tapestry (and Wicket, Spring MVC, Stripes) are presentation frameworks. If you use one of them, you don't use another.
  • Hibernate is a persistence framework and is used to persist Java objects in a relational database.
  • Spring can be used to wire all this together and to provide declarative transaction management.

我不想让事情变得更混乱,但请注意,Java EE 6 提供了与上述框架相当的现代、标准化和非常好的等价物:用于演示的 JSF 2.0 和 Facelets、用于持久性的 JPA 2.0、依赖注入等. 对于新的开发,这是 IMO 一个认真的选择,Java EE 6 是一个伟大的堆栈.

I don't want to make things more confusing but note that Java EE 6 provides modern, standardized and very nice equivalent of the above frameworks: JSF 2.0 and Facelets for the presentation, JPA 2.0 for the persistence, Dependency Injection, etc. For a new development, this is IMO a serious option, Java EE 6 is a great stack.

  • 现在选择 Java Web 框架?李>
  • Java - JDBC 替代方案
  • JEE6 与 Spring 3 堆栈
  • 什么学习在 Java EE 6 中制作 Java Web 应用程序?

相关文章