I am trying to wrap my head around the concept of Dependency Injection. I have a visual studio solution. I have split it into 3 projects: DataAccessLayer, ServiceLayer, BusinessLogicLayer.
The ServiceLayer acts as a link between BusinessLogic and DataAccess hiding things like SQL and LINQ statements from the BusinessLogic.
Now, many tutorials online recommends using DependencyInjection to use the classes in the ServiceLayer in my BusinessLayer. I believe, the reason is so that the BusinessLayer is loosely coupled with the ServiceLayer. I, however, do not fully understand how to implement this when these two layers (and their corresponding classes) are in different projects.
According to online tutorials, I will have my classes in ServiceLayer implement an Interface which is what will be referred to in my BusinessLayer. But which project should this interface be defined? It makes sense that this interface is defined in the ServiceLayer. But wouldn't having a reference to this interface from the BusinessLayer cause a tightly coupled logic between these projects? Would that take away the benefit of Dependency Injection?
I hope someone can give me a "Dependency Injection for Dummies" kind of answer for me explaining where my understanding is wrong. Thank you in advance :)