adspace


How does dependency injection work and why would you need it?

Answer Posted / Awadhesh Kumar Singh

Dependency Injection is a design pattern in which an object receives other objects that it depends on, instead of creating them itself. Spring Framework uses Dependency Injection to manage the lifecycle of application components and their dependencies. It helps in reducing the complexity of managing application components by making them modular and testable.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between @controller and @restcontroller in spring?

556


What is lazy class?

490


How can you inject java collection in spring?

518