IOC at the core of spring principle

IOC: The core of spring is the IOC, the control is transferred from the object itself to the container; the container creates the instance according to the configuration file area and creates the dependencies between each instance and puts it in the container; when the object is used, dynamic injection, Let an object be created without new, it can be automatically produced and obtained from the container. This is actually the use of reflection in java. Reflection is actually to dynamically create and call objects at runtime. Spring configures Spring's configuration files with xml to dynamically create objects and call methods in objects at runtime.

Core container class:

Taking ApplicationContext as the core interface design, the main interface designs involved here are from BeanFactory to ListableBeanFactory, to ApplicationContext, and then to our commonly used WebApplicationContext or ConfigurableApplicationContext interface. Our commonly used applications are basically the implementation of WebApplicationContext or ConfigurableApplicationContext in the org.framework.context package. In this interface embodiment, ListableBeanFactory and HierarchicalBeanFactory are two interfaces, which connect the interface definition of BeanFactory and the interface definition of ApplicationContext application. In the ListableBeanFactory interface, many interface functions of the BeanFactory are refined, for example, the getBeanDefinitionNames() interface method is defined; for the ApplicationContext interface, it inherits the MessageSource, ResourceLoader, ApplicationEventPublisher interfaces, and adds many advanced pairings to the BeanFactory simple Ioc container. Container features support functionality.

Guess you like

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