Dependency Injection in Springboot
Reading Time: 2 minutes What is Dependency Injection? It helps in injecting one object into another object Make it easy to do loose coupling Managing and testing the code becomes easy Removes dependency from the program and provides information externally Consider an example: class Student { Marks marks; Student(Marks marks){ this.marks=marks; } public void setMarks(Marks marks){ this.marks=marks; } } Here the instance of Marks class is provided externally That Continue Reading