What is Dependency Injection and Inversion of Control in Spring Framework?

前端 未结 11 2441
你的背包
你的背包 2020-12-02 03:51

\"Dependency Injection\" and \"Inversion of Control\" are often mentioned as the primary advantages of using the Spring framework for developing Web frameworks

Could

11条回答
  •  长情又很酷
    2020-12-02 04:29

    In simple terms.. In simple terms..

    • IOC(Inversion of Control) is a concept means: Instead of creating objects by new operator,let the container do it for you.
    • DI(Dependency injection) is way to inject the dependency of a framework component by the following ways of spring:
    1. Contructor injection
    2. Setter/Getter injection

提交回复
热议问题