What is IOC?

Alibaba cloud Q & A 2022-02-13 05:14:51 阅读数:829

ioc

A detailed description ?




Take the answer 1:

IOC (Inversion Of Control, Control reversal ), yes spring At the heart of , Throughout , So-called IOC , about spring Frame speaking , Is the spring To control the object's life cycle and the relationship between objects . All classes will be in spring Register... In container , tell spring What are you , What do you need? , then spring When the system is running properly , Offer you what you want , At the same time, give you to other things that need you . Creation of all classes 、 Destroyed by spring To control , That is to say, it is no longer the object that references it that controls the object's life cycle , It is spring. For a specific object , It used to control other objects , Now it's all the objects that are spring control , So this is called inversion of control .


copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130514496417.html