Seven modules of Spring

 Seven modules of the Spring Framework

 

The Spring Framework is a layered architecture consisting of 7 well-defined modules. Spring modules are built on top of the core container, which defines how beans are created, configured, and managed, as shown in Figure 1.

Each module (or component) that makes up the Spring Framework can exist alone, or be implemented in conjunction with one or more other modules. The function of each module is as follows: ! h! r; G% ?7 r2 r+ s

Core container (Spring core)

The core container provides the basic functionality of the Spring framework. Spring organizes and manages various components and their relationships in a Java application in the form of beans. Spring uses BeanFactory to generate and manage beans, which is an implementation of the factory pattern. BeanFactory uses the Inversion of Control (IoC) pattern to separate the application's configuration and dependency specification from the actual application code. BeanFactory uses dependency injection to provide component dependencies.

 

Spring context

A Spring context is a configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as JNDI, EJB, email, internationalization, validation and scheduling functions

 

Spring Aspect Oriented Programming (Spring AOP)

The Spring AOP module integrates aspect-oriented programming capabilities directly into the Spring Framework through configuration management features. Therefore, it is easy to make any object managed by the Spring framework AOP-aware. The Spring AOP module provides transaction management services for objects in Spring-based applications. By using Spring AOP, declarative transaction management can be integrated into applications without relying on EJB components.


Spring DAO module

The main purpose of the DAO pattern is to isolate persistence layer related issues from general business rules and workflows. DAO in Spring provides a consistent way to access the database, no matter what persistence technology is used, Spring provides a consistent programming model. Spring also provides a consistent DAO-style exception hierarchy for different persistence layer technologies.

 

Spring ORM module

Spring integrates well with all major ORM mapping frameworks, including Hibernate, JDO implementations, TopLink and IBatis SQL Map, etc. Spring provides helper classes such as templates for all of these frameworks to achieve a consistent programming style.

 

Spring Web Module

The web context module builds on the application context module and provides context for web-based applications. The web layer uses the web layer framework, which can optionally be Spring's own MVC framework, or the provided web frameworks, such as Struts, Webwork, tapestry, and jsf.

 

Spring MVC框架(Spring WebMVC)

The MVC framework is a full-featured MVC implementation for building web applications. Through the strategy interface, the MVC framework becomes highly configurable. Spring's MVC framework provides a clear separation of roles: controllers, validators, command objects, form and model objects, dispatchers, handler mappings, and view resolvers. Spring supports a variety of view technologies.  
3 ~9 _* n; E2 E8 v7 ]* V
The features of the Spring framework can be used in any J2EE server, and most of the features are also suitable for unmanaged environments. The core point of Spring is to support reusable business and data access objects that are not tied to specific J2EE services. There is no doubt that such objects can be reused between different J2EE environments (Web or EJB), stand-alone applications, test environments.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326618873&siteId=291194637