spring6 overview

Spring6 requires the minimum version of JDK to be JDK17  

What is Spring?

Spring is a mainstream Java EE lightweight open source framework . Spring was proposed and founded by "Father of Spring" Rod Johnson. Its purpose is to simplify the development difficulty and development cycle of Java enterprise applications. The use of Spring is not limited to server-side development. Any Java application can benefit from Spring in terms of simplicity, testability, and loose coupling. In addition to providing its own functions, the Spring framework also provides the ability to integrate other technologies and frameworks.

Spring has been favored since its inception, and has been regarded as the first choice by developers for Java enterprise application development. Today, Spring has become synonymous with Java EE and the de facto standard for building Java EE applications.

Since the official release of Spring 1.0 in April 2004, Spring has entered the sixth major version, which is Spring 6.

Spring's Narrow and Broad Senses

In different contexts, Spring represents different meanings. Next, we will introduce Spring from the perspectives of "broad sense" and "narrow sense".

Spring in a broad sense: Spring technology stack

Spring in a broad sense refers to the Spring technology stack with Spring Framework as the core.

After more than ten years of development, Spring is no longer a pure application framework, but has gradually developed into a mature technology composed of multiple different sub-projects (modules), such as Spring Framework, Spring MVC, SpringBoot, Spring Cloud, Spring Data, Spring Security, etc., among which Spring Framework is the basis of other sub-projects.

These sub-projects cover everything from enterprise-level application development to cloud computing, and can help developers solve various practical problems that arise in the process of software development, bringing developers a better development experience.

Spring in a narrow sense: Spring Framework

Spring in a narrow sense refers specifically to the Spring Framework, which we usually refer to as the Spring Framework.

The Spring framework is a layered, one-stop lightweight solution for aspect-oriented Java applications. It is the core and foundation of the Spring technology stack and was created to solve the complexity of enterprise-level application development.

Spring has two core modules: IoC and AOP.

IoC: Short for Inverse of Control, translated as "inversion of control", which refers to handing over the process of creating objects to Spring for management.

AOP: Short for Aspect Oriented Programming, translated as "aspect-oriented programming". AOP is used to encapsulate the public behavior of multiple classes, and encapsulate the logic that has nothing to do with business but is commonly called by business modules, so as to reduce the duplication of code in the system and the coupling between modules. In addition, AOP also solves some system-level problems, such as logs, transactions, permissions, etc.

Spring Framework Features

  • Non-intrusive: When developing an application using the Spring Framework, Spring has very little impact on the structure of the application itself. Zero pollution can be achieved on the domain model; only a few simple annotations are needed to mark the functional components, which will not destroy the original structure at all, but can further simplify the component structure. This makes the structure clear, concise and elegant when developing applications based on Spring Framework.
  • Inversion of Control: IoC——Inversion of Control, reversing the direction of resource acquisition. Turn creating resources by yourself and requesting resources from the environment into the environment preparing resources, and we enjoy resource injection.
  • Aspect Oriented Programming: AOP——Aspect Oriented Programming, which enhances code functions without modifying source code.
  • Container: Spring IoC is a container because it contains and manages the lifecycle of component objects. Components enjoy containerized management, which shields programmers from a large number of details in the component creation process, greatly reduces the threshold for use, and greatly improves development efficiency.
  • Componentization: Spring implements the composition of a complex application using simple component configurations. These objects can be combined in Spring using XML and Java annotations. This allows us to build super-large and complex application systems in an orderly manner based on components with clear functions and clear boundaries.
  • One-stop shop: On the basis of IoC and AOP, open source frameworks and excellent third-party class libraries of various enterprise applications can be integrated. Moreover, the projects under Spring have covered a wide range of fields, and many functional requirements can be realized using Spring on the basis of Spring Framework.

Spring module composition

The above figure contains all the modules of the Spring framework. These modules can meet the needs of all enterprise-level application development. During the development process, the required modules can be selectively used according to the requirements. The functions of these modules are briefly introduced below.

①Spring Core (core container)

Spring core provides the core implementation of IOC, DI, and Bean configuration loading creation. Core concepts: Beans, BeanFactory, BeanDefinitions, ApplicationContext.

- spring-core: the basic implementation of IOC and DI

- spring-beans: BeanFactory and Bean assembly management (BeanFactory)
- spring-context: Spring context context, that is, IOC container (AppliactionContext)
- spring-expression: spring expression language

②Spring AOP

- spring-aop: application module for aspect programming, integrating ASM, CGLib, JDK Proxy
- spring-aspects: integrating AspectJ, AOP application framework
- spring-instrument: dynamic Class Loading module

③Spring Data Access

- spring-jdbc: spring's encapsulation of JDBC, used to simplify jdbc operations
- spring-orm: mapping framework for java objects and database data
- spring-oxm: mapping framework for objects and xml files
- spring-jms: Spring for Java Message Service (java message service) encapsulation, used for mutual communication between services
- spring-tx: spring jdbc transaction management

④Spring Web

- spring-web: the most basic web support, built on spring-context, initialize the IOC container through servlet or listener
- spring-webmvc: implement web mvc
- spring-websocket: full-duplex communication protocol with the front end
- spring -webflux: Provided by Spring 5.0, used to replace traditional java servlet, non-blocking Reactive Web framework, asynchronous, non-blocking, event-driven services

⑤Spring Message

- Spring-messaging: Provided by spring 4.0, it integrates some basic messaging services for Spring

⑥Spring test

- spring-test: integration test support, mainly the encapsulation of junit

Guess you like

Origin blog.csdn.net/m0_62436868/article/details/130517052