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



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

Answer / 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

More Spring Framework Interview Questions

What are the components of spring framework?

1 Answers  


What is difference between oauth and oauth2?

1 Answers  


What is the purpose of contextloaderlistener in spring?

1 Answers  


What is loosely coupling in spring?

1 Answers  


How many modules are there in spring?

1 Answers  


Why spring is used in java?

1 Answers  


What are 3 types of annotations?

1 Answers  


How can you achieve internationalization using messagesource?

1 Answers  


How annotation wiring can be turned on in spring?

1 Answers  


What is the benefit of factory pattern?

1 Answers  


What are classes for spring jdbc api?

1 Answers  


What is @entity in spring boot? : Spring Boot

1 Answers  


Categories