What problem does dependency injection solve?



What problem does dependency injection solve?..

Answer / Shilpi Sharma

Dependency Injection solves the problem of tight coupling between objects by inverting the flow of control. Instead of objects creating and managing their dependencies, the dependencies are injected into them at runtime. This makes code more modular, easier to test, and promotes loose coupling.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Spring Framework Interview Questions

What is spring configuration file?

1 Answers  


What is the ioc in spring?

1 Answers  


What are the examples of standard spring events?

1 Answers  


What is dependency injection in spring?

1 Answers  


What is root context in spring?

1 Answers  


What are the ways by which hibernate can be accessed using spring?

1 Answers  


What is the use of @service annotation in spring?

1 Answers  


Write about the different types of listener related events?

1 Answers  


What is @controller in spring?

1 Answers  


How does @transactional work in spring?

1 Answers  


What are spring mvc annotations?

1 Answers  


What is the default scope of spring component?

1 Answers  


Categories