1.

What is a Spring IoC container?

Answer»

Inversion of CONTROL (IOC) is a concept or principle where the control flow of a program is inverted i.e. instead of the program, the FRAMEWORK takes control of creating and proving objects as required. Spring IoC is responsible for creating the objects, wiring them as PER the configuration and managing the complete lifecycle from creation till destruction.

IoC can be implemented using two techniques namely Dependency Lookup and Dependency Injection.

Dependency Lookup is a traditional approach where a component must acquire a reference to a dependency. It helps in decoupling the components of the application but adds complexity in the form of the additional code that is required to couple these components back together to perform tasks.

This is the reason; Dependency Injection is considered a more viable and popular approach to implement IoC in Spring-based applications.



Discussion

No Comment Found