Spring IOC, DI, and springiocdi
IOC (Inverse of Control) Control Inversion
Java is life. --------- we need to rent a house. at present, we do not need to find a specific landlord (new fangdong () Landlord object to rent his house fangdong. rent ()). if we are not satisfied with the landlord's house, it's too far away from the subway ..... heh. we also need to find the next landlord, new, and next landlord. the IOC container is like an intermediary with many houses in his hand. as long as we use this intermediary third party, we can choose the right housing. the existence of intermediary reduces the coupling between you and the landlord. the intermediary increases your fault tolerance,
Underlying Implementation of IOC: factory design mode + radiation + configuration file;
DI (Dependency Injection) Dependency Injection
Only the javabean managed by Spring (get objects through ioc) has dependency injection (self-created objects cannot be dependent on injection)
Dependency injection is a special implementation of IOC. We have implemented the coupling relationship between classes and classes. However, you also need to create a spring factory when getting the object. DI can dynamically inject dependent objects into bean components.