Introduction to Spring

Introduction to Spring

The core of Spring is a lightweight (Lightweight) container (Container), which is a framework for implementing IoC (Inversion of Control) container and non-intrusive (No intrusive), and provides the implementation of the concept of AOP (Aspect-oriented programming) It provides support for persistence layer (Persistence) and transaction (Transcation); provides the implementation of MVC Web framework, and provides consistent model encapsulation for some commonly used enterprise service APIs (Application Interface), which is a comprehensive application framework. (Application Framework), in addition to various existing frameworks (Structs, JSF, Hibernate, Ibatis, Webwork, etc.), Spring also provides solutions to integrate with them. → Answer analysis: For the interviewer's answer to what is Spring, this question accounts for 6 points, and the distribution of points is: 1. The core of Spring is a lightweight (Lightweight) container (Container). Lightweight: The program implementation is not very complicated, the code is not a lot, the resource consumption is not a lot, and there is no intrusiveness; Container: It can hold objects and control the life cycle of objects; 2. Spring is a container that implements IoC (Inversion of Control) and No intrusive framework. IOC (Inversion of Control): The inversion of object creation responsibility (emphasis, core); 3. Spring provides an implementation of the concept of AOP (Aspect-oriented programming). Aop(Aspect Oriented Programming): A way of thinking about cross-cutting programming that can be functionally extended. 4. Spring provides support for Persistence and Transcation. 5. Spring provides the implementation of MVC Web framework and provides consistent model encapsulation for some commonly used enterprise service APIs (Application Interface). 6. Spring provides solutions for integrating various existing frameworks (Structs, JSF, Hibernate, Ibatis, Webwork, etc.). In conclusion, Spring is an all-encompassing application framework.

The knowledge points to be learned by Spring are as follows:

 

 

 

The main functions of Spring are as follows:

 

This side mainly includes Spring's own functions, as well as some frameworks that can be combined with its framework. From this picture, we can see that the integration ability of Spring framework and other frameworks is very strong.

Pros and Cons of Spring

advantage:
	Lightweight container framework, not intrusive
	IoC makes it easier to combine the relationship between objects, and it can be developed with low coupling through interface-oriented programming.
	Easy to test locally (Junit unit tests, no deployment server)
	AOP can be more easily extended functions, following the principles of OCP development.
	Spring's default object is created as a singleton, and we no longer need to use the singleton design pattern to develop singleton classes.
	The integration of Spring is very powerful, and the configuration of other frameworks can be managed in a unified manner.
	Convenient use of Spring's declarative transactions.
      shortcoming:
	That is, the development has high design requirements, the integration test is troublesome, and there is a certain dependence on the framework.
 

 

Guess you like

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