码迷,mamicode.com
首页 > 编程语言 > 详细

Spring Framework Overview

时间:2020-03-23 15:12:44      阅读:91      评论:0      收藏:0      [点我收藏+]

标签:backward   asi   事务   传递   xib   change   let   time   module   

Spring makes it easy to create Java enterprise applications. It provides everything you need to embrace the Java language in an enterprise environment, with support for Groovy and Kotlin as alternative languages on the JVM, and with the flexibility to create many kinds of architectures depending on an application’s needs. As of Spring Framework 5.1, Spring requires JDK 8+ (Java SE 8+) and provides out-of-the-box support for JDK 11 LTS.

Spring 简化了 Java EE 程序的开发,它提供了在企业环境中使用 Java 所需的一切,并支持 Groovy 和 Kotlin 作为 JVM 上的替代语言,可以根据需要灵活创建多种体系结构。

从Spring Framework 5.1开始,需要 JDK 8+ (Java SE 8+),并提供对 JDK 11 LTS 的开箱即用支持。

Spring supports a wide range of application scenarios. In a large enterprise, applications often exist for a long time and have to run on a JDK and application server whose upgrade cycle is beyond developer control. Others may run as a single jar with the server embedded, possibly in a cloud environment. Yet others may be standalone applications (such as batch or integration workloads) that do not need a server.

Spring 支持广泛的应用场景。在大型企业中,应用通常存在很长时间,必须在 JDK 和应用服务器上运行,而升级周期却超出了开发人员的控制,其他的应用可能是在云环境中以单个 jar 包的形式运行,还有一些可能是不需要服务器的独立应用程序(例如批处理或集成工作负载)。

1. Spirng 所指为何

The term "Spring" means different things in different contexts. It can be used to refer to the Spring Framework project itself, which is where it all started. Over time, other Spring projects have been built on top of the Spring Framework. Most often, when people say "Spring", they mean the entire family of projects. This reference documentation focuses on the foundation: the Spring Framework itself.

Spring 在不同语境中有不同含义,它可以指 Spring Framework 本身,这是其他一切的起点,其他 Spring 项目构建在 Spring Framework 之上。通常,Spring 指的是整个项目家族。

The Spring Framework is divided into modules. Applications can choose which modules they need. At the heart are the modules of the core container, including a configuration model and a dependency injection mechanism. Beyond that, the Spring Framework provides foundational support for different application architectures, including messaging, transactional data and persistence, and web. It also includes the Servlet-based Spring MVC web framework and, in parallel, the Spring WebFlux reactive web framework.

Spring Framework 被划分为多个可选择的模块。它的核心是 core container 模块,包括配置模型和依赖注入机制。除此之外,Spring Framework 还为不同的应用体系结构提供基础支持,包括消息传递、事务数据、持久层和 web。它还包括基于 servlet 的 Spring MVC web 框架,以及与之并行的 Spring WebFlux reactive web 框架。

2. spring 的历史

Spring came into being in 2003 as a response to the complexity of the early J2EE specifications. While some consider Java EE and Spring to be in competition, Spring is, in fact, complementary to Java EE. The Spring programming model does not embrace the Java EE platform specification; rather, it integrates with carefully selected individual specifications from the EE umbrella:

Spring 是在 2003 年为了应对早期 J2EE 规范的复杂性而出现的,应该将 Spring 视为 Java EE 的补充。Spring 编程模型没有包含 Java EE 平台规范;相反,它集成了 Java EE 中个别精心挑选的规范:

  • Servlet API (JSR 340)
  • WebSocket API (JSR 356)
  • Concurrency Utilities (JSR 236)
  • JSON Binding API (JSR 367)
  • Bean Validation (JSR 303)
  • JPA (JSR 338)
  • JMS (JSR 914),JAVA Message Service

以及 JTA/JCA 设置,以便在必要时进行事务协调。

Over time, the role of Java EE in application development has evolved. In the early days of Java EE and Spring, applications were created to be deployed to an application server. Today, with the help of Spring Boot, applications are created in a devops- and cloud-friendly way, with the Servlet container embedded and trivial to change. As of Spring Framework 5, a WebFlux application does not even use the Servlet API directly and can run on servers (such as Netty) that are not Servlet containers.

随着时间的推移,Java EE 在应用程序开发中的角色已经发生了变化。在 Java EE 和 Spring 的早期,应用程序被创建并部署到服务器上。现在,在 Spring Boot 的帮助下,应用程序以一种“开发运营”和云友好的方式创建,嵌入了 Servlet 容器,而且更改起来很简单。从 Spring Framework 5 开始,WebFlux 应用程序甚至不直接使用 Servlet API,可以在不是 Servlet 容器的服务器(如 Netty)上运行。

Spring continues to innovate and to evolve. Beyond the Spring Framework, there are other projects, such as Spring Boot, Spring Security, Spring Data, Spring Cloud, Spring Batch, among others. It’s important to remember that each project has its own source code repository, issue tracker, and release cadence.

Spring 持续创新和进化。除了 Spring FrameWork 之外,还有其他项目,比如 Spring Boot、Spring Security、Spring Data、Spring Cloud、Spring Batch...每个项目都有自己的源代码库、问题跟踪器和发布节奏。

3. 设计理念

Provide choice at every level. Spring lets you defer design decisions as late as possible. For example, you can switch persistence providers through configuration without changing your code. The same is true for many other infrastructure concerns and integration with third-party APIs.

**在每个层次上提供选择。**Spring 允许我们不必在一开始就进行完全的设计决策。例如,(当我们想要改变持久层的设计时)可以通过配置切换持久层的提供方,而无需更改代码。对于许多其他基础构件问题和与第三方 api 的集成也是如此。

Accommodate diverse perspectives. Spring embraces flexibility and is not opinionated about how things should be done. It supports a wide range of application needs with different perspectives.

**容纳不同的观点。**Spring 支持灵活性,对于事情应该如何完成没有特定约束,支持具有不同视角的广泛的应用需求。

Maintain strong backward compatibility. Spring’s evolution has been carefully managed to force few breaking changes between versions. Spring supports a carefully chosen range of JDK versions and third-party libraries to facilitate maintenance of applications and libraries that depend on Spring.

**保持强大的向后兼容性。**Spring 的发展已经被小心地管理,在不同的版本之间很少有中断的变化。Spring 支持精心选择的 JDK 版本和第三方库,以方便维护依赖于它的应用程序和库。

Care about API design. The Spring team puts a lot of thought and time into making APIs that are intuitive and that hold up across many versions and many years.

**关心API设计。**Spring 团队投入了大量的思想和时间来开发直观的 api,可以在未来很长时间里支持多个版本。

Set high standards for code quality. The Spring Framework puts a strong emphasis on meaningful, current, and accurate javadoc. It is one of very few projects that can claim clean code structure with no circular dependencies between packages.

**为代码质量设定高标准。**Spring 框架非常强调有意义的、当前适用的、准确的 javadoc。它是少数几个可以声明干净的代码结构且包之间没有循环依赖关系的项目之一。

Spring Framework Overview

标签:backward   asi   事务   传递   xib   change   let   time   module   

原文地址:https://www.cnblogs.com/zzzt20/p/12552169.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!