Traditional Culture Encyclopedia - Traditional customs - Introduction to spring framework

Introduction to spring framework

Spring:

Spring is an open source framework that was created by Rod Johnson. It was created to address the complexity of enterprise application development.Spring uses basic JavaBeans to accomplish things that were previously only possible with EJBs. However, Spring's uses are not limited to server-side development. Any Java application can benefit from Spring in terms of simplicity, testability, and loose coupling.

Spring is a lightweight Inversion of Control (IoC) and Aspect-Oriented (AOP) container framework.

Lightweight - Spring is lightweight in terms of both size and overhead. The complete Spring framework can be released in a JAR file size of just over 1MB. And the processing overhead required by Spring is negligible. In addition, Spring is non-intrusive: typically, objects in a Spring application do not depend on Spring-specific classes.

Inversion of Control - Spring promotes loose coupling through a technique called Inversion of Control (IoC). When IoC is applied, other objects that an object depends on are passed in in a reactive manner, rather than the object creating or looking up dependencies on its own. You can think of IoC as the opposite of JNDI - instead of the object looking up the dependencies from the container, the container actively passes the dependencies to the object without waiting for it to ask for them when the object is initialized.

Cutting-Oriented - Spring provides rich support for cutting-edge programming, allowing for cohesive development by separating an application's business logic from system-level services such as auditing and transaction management. Application objects only do what they are supposed to do - complete the business logic - and that's it. They are not responsible for (or even aware of) other system-level concerns such as logging or transaction support.

Container - Spring contains and manages the configuration and lifecycle of application objects, in the sense that it is a container where you can configure how each of your beans is created - based on a configurable prototype ( Based on a configurable prototype, your beans can create a single instance or spawn a new instance every time they are needed - and how they relate to each other. However, Spring should not be confused with traditional heavyweight EJB containers, which are often large and unwieldy and difficult to use.

Framework - Spring can configure and combine simple components into complex applications. In Spring, application objects are combined declaratively, typically in an XML file.Spring also provides a lot of basic functionality (transaction management, persistence framework integration, etc.), leaving the development of application logic to you.

All of these Spring features enable you to write cleaner, more manageable, and easier-to-test code. They also provide foundational support for the various modules in Spring.