The introduction
The Spring website lists the core modules of the Spring Framework.The Spring Framework consists of about 20 modules. These modules are divided into the following groups: Core Container, Data Access/Integration, Web, AOP, Instrumentation, Messaging, and Test.
Let’s look at the details and role of each module group one by one, with the Artifact ID corresponding to the Artifact ID in the POM file where the dependencies are imported.
1. Core container
The core container includes spring-core, spring-Beans, spring-Context, spring-context-support, and spring-expression (SpEL) modules.
Spring-core and Spring-Beans provide the basic components of the Spring framework, including IoC and DI features. The BeanFactory interface employs a complex factory approach that eliminates the need for programmers to hand-write singleton code and decouples configuration-dependent work from coding logic work.
The Spring-Context module is based on core and Beans modules and is a means of accessing objects in a framework style, similar to JNDI1. The Context module inherits the features of the Bean module and adds new functionality to support internationalization (such as using resource packs), event propagation, resource loading, and Context creation (such as using Servlet containers). The Context module also supports Java EE features such as EJB, JMX, and Basic Remoting. The ApplicationContext interface is the key to the Context module.
The spring-Context-support module supports the integration of common third-party libraries into the Spring application context, especially the caching library (EhCahe, JCache) and the task scheduling library (CommonJ, Quartz).
The Spring-Expression module provides a powerful expression language for querying and manipulating runtime object graph and is an extension of the Unified EL language (JSP 2.1). SpEL functions include setting and extracting attribute values, assigning attributes, calling methods, accessing the contents of arrays, fetching objects from IoC containers by name, and so on.
AOP and tools
The Spring-AOP module provides a faceted programming implementation that meets the requirements of the AOP Alliance. For example, you can define method interceptors and pointcuts to clearly decouple functionality that should be separated. Using source-level metadata capabilities, you can also merge behavior information into your code, similar to. NET property.
A separate Spring-Aspects module is used to integrate AspectJ.
The Spring-Instrument module provides class tooling support and class loader implementation. The Spring-instrument-Tomcat module contains Tomcat built into Spring.
Three, message,
Spring 4 is a new addition to the Spring-Messaging module, which integrates the functions of the Message MessageCannel MessageHandler and other libraries in the Spring integration project. It is the foundation of messaging applications. The module also contains a set of annotations that map messages and methods (@header, @Messagemapping, @payload, @sendto, etc.), similar to the coding pattern based on SpringMVC annotations.
Data access/integration
The data access layer includes JDBC, ORM, OXM, JMS and transaction modules.
The Spring-JDBC module provides a JDBC abstraction layer, eliminating tedious JDBC coding and bad code parsing for different database providers.
The Spring-TX module supports programmatic and declarative transaction management for implementing classes for specific interfaces and all POJOs.
The Spring-ORM module provides popular object-relational mapping apis, including JPA and Hibernate. Using the Spring-ORM module can be combined with other Spring features, such as the declarative transaction management mentioned above.
The Spring-OXM module provides an abstraction layer that supports object-XML mappings such as JAXB, Castor, JiBX, and XStream.
Spring-jms (Java Messaging Service) has been integrated into the Spring-Messaging module since Spring 4. It contains features for message production and consumption.
Five, the Web
The Web layer includes spring-Web Spring-WebMVC and Spring-webSocket modules.
The Spring-Web module provides basic Integration of Web-oriented features, such as file chunking uploading capabilities, and initialization of the IoC container using Servlet listeners and A Web-oriented application context.
The Spring-Web MVC module, also known as the Web-Servlet module, includes the implementation of Spring’s MVC and REST-style Web applications. Spring’s MVC framework clearly separates model code from web forms and integrates with all other Spring framework features.
Six, test,
The Spring-test module supports unit testing and integration testing of Spring components, using JUnit or TestNG. It provides consistent loading of ApplicationContexts and caches for those contexts, as well as mock objects for user unit testing code.
- JNDI (Java Name and Directory Interface), Java naming and Directory Interface, is a standard Java naming system Interface provided by SUN Corporation. ↩