Showing posts with label Dependency Injection. Show all posts
Showing posts with label Dependency Injection. Show all posts

February 19, 2022

#SpringBoot : Tutorial Part 2 (Dependency Injection)



In the previous tutorial we got the gist of the Spring Boot. Before proceeding further let's discuss Dependency Injection.

What is Dependency Injection (DI)?
When writing a complex Java application, application classes should be as independent as possible of other Java classes to increase the possibility to reuse these classes and to test them independently of other classes while doing unit testing. Dependency Injection helps in gluing these classes together and keeping them independent at the same time.

Dependency Injection design pattern allows us to remove the hard-coded dependencies and make our application loosely coupled, extendable and maintainable.