Spring Framework Features

Lightweight - Spring is lightweight in both size and overhead. The complete Spring framework can be distributed in a JAR file of just over 1MB in size. And the processing overhead required by Spring is also trivial. Furthermore, Spring is non-intrusive: typically, objects in a Spring application do not depend on Spring-specific classes.
Inversion of Control - Spring promotes low coupling through a technique called Inversion of Control ( IoC ). When IoC is applied, other objects that an object depends on are passed in passively, rather than the object creating or finding dependent objects by itself. You can think of IoC as the opposite of JNDI - instead of the object looking up dependencies from the container, the container proactively passes dependencies to it when the object is initialized without waiting for the object to request it.
Aspect-Oriented - Spring provides rich support for aspect-oriented programming, allowing cohesive development by separating the application's business logic from system-level services such as auditing and transaction management . Application objects do only what they are supposed to do - complete business logic - nothing more. 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 ( prototype ), your bean A separate instance can be created or a new instance generated each time it is needed - and how they are related to each other. However, Spring should not be confused with traditional heavyweight EJB containers, which are often bulky and bulky and difficult to use.
Framework - Spring can configure and combine simple components into complex applications. In Spring, application objects are composed declaratively, typically in an XML file. Spring also provides many basic functions ( transaction management , persistence framework integration, etc.), leaving the development of application logic to you.
MVC - Spring's role is integration, but not limited to integration, the Spring framework can be seen as an enterprise solution level framework. The client sends the request, the server controller (implemented by DispatcherServlet) completes the forwarding of the request, and the controller calls a class HandlerMapping for mapping, which is used to map the request to the corresponding handler to process the request. HandlerMapping maps the request to the corresponding handler Controller (equivalent to Action). If you write some handler components in Spring, generally implement the Controller interface, you can call some Service or DAO in the Controller to perform data operations. ModelAndView is used to store data from DAO The data retrieved from the view can also be stored in response to some data of the view. If you want to return the processing result to the user, a view component ViewResolver is also provided in the Spring framework, which finds the corresponding view according to the flag returned by the Controller, and returns the response to the user.
All of these features of Spring enable you to write cleaner, more manageable, and easier-to-test code. They also provide basic support for various modules in Spring.

Guess you like

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