So I understand that Dependency Inversion represents the D in SOLID design principles, and I have previously written a web-application using SpringBoot and was wondering if this code example shows a good example of the Dependency Inversion principle in action or not to help me understand this concept properly.
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
/**
* Provides a set of methods for serving and handling Interview data.
*/
@Controller
@SessionAttributes(names = {"users"})
public class InterviewController {
private final InterviewAuditor interviewAuditor;
private final AthleteAuditor athleteAuditor;
/**
* Injects all the needed auditors to talk to the database.
*
* @param interviewAuditor - the interview Auditor.
* @param athleteAuditor - the athlete Auditor.
*/
@Autowired
public InterviewController(InterviewAuditor interviewAuditor, AthleteAuditor athleteAuditor) {
this.interviewAuditor = interviewAuditor;
this.athleteAuditor = athleteAuditor;
}
Thanks!