1. Introduction to Spring

Spring is an open source design-level framework. It solves the problem of loose coupling between the business logic layer and other layers, so it applies the interface-oriented programming idea throughout the entire system application . Spring is a lightweight Java development framework that emerged in 2003, created by Rod Johnson. In short, Spring is a layered JavaSE/EE full-stack (one-stop)  lightweight open source framework.

Features

1. Convenient decoupling and simplified development
Through the IoC container provided by Spring, we can hand over the dependencies between objects to Spring for control, avoiding excessive program coupling caused by hard coding. With Spring, users no longer have to write code for very low-level requirements such as single-instance mode classes, property file parsing, etc., and can focus more on upper-layer applications.
 
2. AOP programming support
The AOP function provided by Spring facilitates aspect-oriented programming, and many functions that are not easy to implement with traditional OOP can be easily handled by AOP.
 
3. Support for declarative transactions
In Spring, we can be freed from the monotonous and boring transaction management code, and flexibly manage transactions in a declarative way to improve development efficiency and quality.
 
4. Convenient program testing
Almost all testing work can be done in a non-container-dependent programmatic way. In Spring, testing is no longer an expensive operation, but something that can be done easily. For example, Spring supports Junit4, and Spring programs can be easily tested through annotations.
 
5. Easy to integrate various excellent frameworks
Spring does not exclude various excellent open source frameworks. On the contrary, Spring can reduce the difficulty of using various frameworks. Spring provides direct support for various excellent frameworks (such as Struts, Hibernate, Hessian, Quartz).
 
6. Reduce the difficulty of using the Java EE API
Spring provides a thin encapsulation layer for many difficult-to-use Java EE APIs (such as JDBC, JavaMail, remote calls, etc.). Through Spring's simple encapsulation, the difficulty of using these Java EE APIs is greatly reduced.
 
7. Java source code is a classic learning paradigm
Spring's source code design is exquisite, the structure is clear, and the originality is ingenious, which reflects the master's flexible use of Java design patterns and the profound knowledge of Java technology. The Spring Framework source code is undoubtedly the best-practice example of Java technology. If you want to quickly improve your Java technology level and application development level in a short period of time, learning and researching Spring source code will make you receive unexpected results.
 
To sum up, Spring has the following advantages:
  1. Low intrusive design, extremely low code pollution
  2. Independent of various application servers , applications based on the Spring framework can truly realize the promise of Write Once, Run Anywhere
  3. Spring's DI mechanism reduces the complexity of business object replacement and improves the decoupling between components
  4. Spring's AOP support allows centralized management of common tasks such as security, transactions, logging, etc., thus providing better reuse
  5. Spring's ORM and DAO provide good integration with third-party persistence layer frameworks and simplify underlying database access
  6. Spring does not force the application to completely depend on Spring, and developers can freely choose part or all of the Spring framework

 

 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325460502&siteId=291194637