Why we are using dependency injection?



Why we are using dependency injection?..

Answer / Jyoti Agnihotri

We use dependency injection to make our code more modular, testable, and easier to maintain. It promotes loose coupling between components in our application by allowing us to separate the concerns of object creation and management from the business logic.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Spring Framework Interview Questions

How to use tomcat jndi datasource in spring web application?

1 Answers  


Can we have multiple spring configuration files?

1 Answers  


How does spring singleton work?

1 Answers  


What is spring security?

1 Answers  


What is difference between @autowired and @resource in spring?

1 Answers  


What is webapplicationinitializer in spring?

1 Answers  


What are the various ways of using spring framework?

1 Answers  


How many modules are there in spring framework and what are they?

1 Answers  


What are spring boot starter projects? : Spring Boot

1 Answers  


What are the examples of standard spring events?

1 Answers  


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

1 Answers  


Write about aop module?

1 Answers  


Categories