[SSM-Spring Chapter 01] Introduction to spring

Introduction to Spring

  Spring is a lightweight Java development framework that was first created by Rod Johnson to solve the coupling problem between the business logic layer and other layers of enterprise-level application development .
  It is a layered JavaSE/EEfull-stack (one-stop) lightweight open source framework that provides comprehensive infrastructure support for developing Java applications. Spring is responsible for the infrastructure, so Java developers can focus on application development.
  Spring is a lightweight Inversion of Control (IoC) and aspect-oriented (AOP) of the container frame
  ideological basis Spring is oriented programming Bean's (BOP, Bean Oriented Programming)

Spring architecture

Insert picture description here

Spring core container (Core Container)

  Spring core container is mainly composed of Beans, Core, Context, SpEL composition

  • Core module: provides a basic element of the framework, including inversion of control (Inversion of Control, IoC) and dependency injection (Dependency Injection, DI) function.
  • Beans module: Provides BeanFactory, which is a classic implementation of the factory pattern . Spring refers to the management object as Bean. Solve the definition of Bean, the creation of Bean, and the analysis of Bean. We only need to pay attention to the creation of Bean, the other two are done internally by Spring and are transparent to use.
  • Context module: Based on the Core and Beans modules, it provides a framework for object access, which is a medium for accessing any object defined and configured. The ApplicationContext interface is the focus of the Context module.
  • SpEL (expression) module: Provides a powerful expression language to support runtime query and manipulate object graphs. (Similar to using EL expressions on jsp, except that this expression is used in spring configuration files)
  • Among them, Core, Beans and Context constitute the skeleton of Spring. Context is based on the Core module and the Beans module and provides a framework for accessing objects.

Data Access/Integration

  Data Access / Integration layer of JDBC, ORM, OXM, JMS, and transaction modules consisting of

  • Spring-jdbc module: Provides a JDBC abstraction layer, eliminating tedious JDBC coding and error code analysis unique to database vendors.
  • Spring-tx module (transaction module) : Supports programming and declarative transaction management for implementing special interfaces and all POJO (common Java object) classes .
  • Spring-orm module: popular object -relational mapping provides integration layer (Object-Relational Mapping) API, and comprising JPA Hibernate. Using the Spring-orm module, these O/R mapping frameworks can be combined with all other features provided by Spring, such as declarative transaction management.
  • Spring-oxm module: Provides an abstraction layer implementation that supports object/XML mapping, such as JAXB, Castor, JiBX and XStream.
  • Spring-jms module (Java Messaging Service): Refers to the Java messaging service, including functions for producing and using messages. Since Spring 4.1, integration with Spring-messaging module has been provided.

web

  The web layer is composed of Spring-web, Spring-webmvc, Spring-websocket and Portlet modules .

  • Spring-web module: Provides basic web development integration functions. For example: multi-file upload function, use Servlet listener to initialize an IoC container and Web application context.
  • Spring-webmvc module: also known as Web-Servlet module, contains Spring MVC and REST Web Services implementation for web applications. The Spring MVC framework provides a clear separation between domain model code and web forms, and integrates with all other features of the Spring Framework.
  • Spring-websocket module: a new module after Spring 4.0, it provides the implementation of WebSocket and SockJS.
  • Portlet module: Similar to the function of the Servlet module, it provides the implementation of MVC in the Portlet environment.

Test

Spring-test module: Supports unit testing and integration testing of Spring components using JUnit or TestNG.
(Write a test class, add annotations, and automatically load the configuration file when running to simulate the operation of the server)

Guess you like

Origin blog.csdn.net/qq_40542534/article/details/108679699