we started a new project in which back end consists of several layers (each in different project).
For simplifaction I'll define a few:
- Project.Data -data layer with access to db
- Project.Repository - repos
- Project.Repository.Interfaces - only repos interfaces
- Project.WebApi - API
Our team leader proposed we should block access to resources between the projects on the reference level. Now the only thing API will be referencing in this examnple is Project.Repository.Interfaces. There we inject interfaces using Dependency Injection. Like I said this is a simple version not including Services and Dtos.
Idea behind this was that WebAPI should only use DI to access resources. Also WebAPI should have access to DTO's not directly to database entities. This is all great but of course there are a few problems that were encountered and I'm not sure how to solve them:
a) Nuget packages installed into Project.Repository is not being copied to WebAPI (Runtime exception about missing dll)
b) using .NET Core CLI and dotnet watch run to start a project locally doesn't track changes in the child projects since they are not directly referenced.
I see the vision behind this loose coupling idea but this is really cumbersome. Is this a tradeoff you have to live with in such a situation or is there a solution for this ?