I am using StructureMap to do DI in my ASP.NET MVC Project. I have divided my libraries into the following 3 dlls.
- Core
- Services
- Data (Contains repositories)
The core simply contain all the interfaces and services and data contain their implementation.
Now when I setup StructureMap in the website I need to tell it to scan the services and data assemblies as they contain the implementation of the core interfaces but this would mean I will have to reference them both in the web project although it depends on service project only which then depends on the data project.
To me referencing these two dlls in web project does not make sense as it spoils the benefit of abstraction?
Can some one please explain to me if I need to reference these assemblies or not and then what is the advantage of using separate interfaces in the first place?