4
4
= Spring Framework Overview
5
5
6
6
Spring makes it easy to create Java enterprise applications. It provides everything you
7
- need beyond the Java language itself. It also provides extensions and support for
8
- applications created in Groovy and Kotlin.
7
+ need to embrace the Java language in an enterprise environment, with support for Groovy
8
+ and Kotlin as alternative languages on the JVM, and with the flexibility to create many
9
+ kinds of architectures depending on an application's needs. As of Spring Framework 5.0,
10
+ Spring requires JDK 8+ (Java SE 8+) and provides out-of-the-box support for JDK 9 already.
9
11
10
- Spring supports a wide range of application scenarios. In a large enterprise, applications
12
+ Spring supports a wide range of application scenarios. In a large enterprise, applications
11
13
often exist for a long time and have to run on a JDK and application server whose upgrade
12
14
cycle is beyond developer control. Others may run as a single jar with the server embedded,
13
15
possibly in a cloud environment. Yet others may be standalone applications (such as batch
@@ -19,45 +21,59 @@ evolve over a very long time.
19
21
20
22
== What We Mean by "Spring"
21
23
22
- The term, "Spring, " means different things in different contexts. It can be used to refer to
24
+ The term "Spring" means different things in different contexts. It can be used to refer to
23
25
the Spring Framework project itself, which is where it all started. Over time, other Spring
24
- projects have been built on top of the Spring Framework. Most often, when people say,
25
- “ Spring,” they mean the entire family of projects. This reference documentation focuses on
26
- the Spring Framework.
26
+ projects have been built on top of the Spring Framework. Most often, when people say
27
+ " Spring", they mean the entire family of projects. This reference documentation focuses on
28
+ the foundation: the Spring Framework itself .
27
29
28
30
The Spring Framework is divided into modules. Applications can choose which modules they need.
29
31
At the heart are the modules of the core container, including a configuration model and a
30
32
dependency injection mechanism. Beyond that, the Spring Framework provides foundational
31
33
support for different application architectures, including messaging, transactional data and
32
- persistence, and web. It also includes the servlet -based Spring MVC web framework and, in
34
+ persistence, and web. It also includes the Servlet -based Spring MVC web framework and, in
33
35
parallel, the Spring WebFlux reactive web framework.
34
36
37
+ A note about modules: Spring's framework jars allow for deployment to JDK 9's module path
38
+ ("Jigsaw"). For use in Jigsaw-enabled applications, the Spring Framework 5 jars come with
39
+ "Automatic-Module-Name" manifest entries which define stable language-level module names
40
+ ("spring.core", "spring.context" etc) independent from jar artifact names (the jars follow
41
+ the same naming pattern with "-" instead of ".", e.g. "spring-core" and "spring-context").
42
+ Of course, Spring's framework jars keep working fine on the classpath on both JDK 8 and 9.
43
+
35
44
== History of Spring and the Spring Framework
36
45
37
46
Spring came into being in 2003 as a response to the complexity of the early
38
47
https://en.wikipedia.org/wiki/Java_Platform,_Enterprise_Edition[J2EE] specifications.
39
48
While some consider Java EE and Spring to be in competition, Spring is, in fact, complementary
40
- to Java EE. Spring does not support every Java EE specification. Rather, it integrates with
41
- a carefully selected subset of the most widely used Java EE specifications :
49
+ to Java EE. The Spring programming model does not embrace the Java EE platform specification;
50
+ rather, it integrates with carefully selected individual specifications from the EE umbrella :
42
51
43
- * JPA (https://jcp.org/en/jsr/detail?id=338[JSR 338])
44
- * JMS (https://jcp.org/en/jsr/detail?id=914[JSR 914])
45
52
* Servlet API (https://jcp.org/en/jsr/detail?id=340[JSR 340])
46
- * WebSockets (https://www.jcp.org/en/jsr/detail?id=356[JSR 356])
53
+ * WebSocket API (https://www.jcp.org/en/jsr/detail?id=356[JSR 356])
54
+ * Concurrency Utilities (https://www.jcp.org/en/jsr/detail?id=236[JSR 236])
47
55
* JSON Binding API (https://jcp.org/en/jsr/detail?id=367[JSR 367])
48
56
* Bean Validation (https://jcp.org/en/jsr/detail?id=303[JSR 303])
57
+ * JPA (https://jcp.org/en/jsr/detail?id=338[JSR 338])
58
+ * JMS (https://jcp.org/en/jsr/detail?id=914[JSR 914])
59
+ * as well as JTA/JCA setups for transaction coordination, if necessary.
49
60
50
61
The Spring Framework also supports the Dependency Injection
51
62
(https://www.jcp.org/en/jsr/detail?id=330[JSR 330]) and Common Annotations
52
63
(https://jcp.org/en/jsr/detail?id=250[JSR 250]) specifications, which application developers
53
- can choose to use instead of the same mechanisms provided by the Spring Framework.
64
+ may choose to use instead of the Spring-specific mechanisms provided by the Spring Framework.
65
+
66
+ As of Spring Framework 5.0, Spring requires the Java EE 7 level (e.g. Servlet 3.1+, JPA 2.1+)
67
+ as a minimum - while at the same time providing out-of-the-box integration with newer APIs
68
+ at the Java EE 8 level (e.g. Servlet 4.0, JSON Binding API) when encountered at runtime.
69
+ This keeps Spring fully compatible with e.g. Tomcat 8 and 9, WebSphere 9, and JBoss EAP 7.
54
70
55
71
Over time, the role of Java EE in application development has evolved. In the early days of
56
72
Java EE and Spring, applications were created to be deployed to an application server.
57
73
Today, with the help of Spring Boot, applications are created in a devops- and
58
- cloud-friendly way, with the servlet container embedded and trivial to change.
59
- As of Spring 5, a WebFlux application does not even use the Servlet API directly and can
60
- run on servers (such as Netty) that are not servlet containers.
74
+ cloud-friendly way, with the Servlet container embedded and trivial to change.
75
+ As of Spring Framework 5, a WebFlux application does not even use the Servlet API directly
76
+ and can run on servers (such as Netty) that are not Servlet containers.
61
77
62
78
Spring continues to innovate and to evolve. Beyond the Spring Framework, there are other
63
79
projects, such as Spring Boot, Spring Security, Spring Data, Spring Cloud, Spring Batch,
0 commit comments