Spring Framework 5.0.0.M3中文文档 翻译记录 Part I. Spring框架概览2.3

时间:2021-08-19 21:33:20

2.3 Usage scenarios 使用场景

The building blocks described previously make Spring a logical choice in many scenarios, from embedded applications that run on resource-constrained devices to full-fledged enterprise applications that use Spring’s transaction management functionality and web framework integration.

之前描述的构建块使Spring成为许多场景中的逻辑(也就是下意识合理的)选择,从资源受限的嵌入式程序到成熟的企业应用程序都可以使用 Spring 事务管理功能和 web 框架集成。

图2.2。 典型的完整Spring Web应用程序

Spring Framework 5.0.0.M3中文文档 翻译记录 Part I. Spring框架概览2.3

Spring’s declarative transaction management features make the web application fully transactional, just as it would be if you used EJB container-managed transactions. All your custom business logic can be implemented with simple POJOs and managed by Spring’s IoC container. Additional services include support for sending email and validation that is independent of the web layer, which lets you choose where to execute validation rules. Spring’s ORM support is integrated with JPA and Hibernate; for example, when using Hibernate, you can continue to use your existing mapping files and standard Hibernate SessionFactory configuration. Form controllers seamlessly integrate the web-layer with the domain model, removing the need for ActionForms or other classes that transform HTTP parameters to values for your domain model.

Spring的声明式事务管理特性使Web应用程序具有完全事务性,就像使用EJB容器管理的事务一样。 所有的定制业务逻辑都可以通过简单的POJO实现,并由SpringIoC容器管理。 其他服务包括独立于Web层的发送电子邮件和验证的支持,允许你选择执行验证规则的位置。 SpringORM支持集成了JPAHibernate