I am starting with ASP.NET MVC and trying to learn DI and dependency inversion at the same time. I am setting up at MVC project where the controllers and views reside in one assembly and I also have a couple of more assemblies for domain models and services that to most of the actual business logic.
The plan is to have all my services implement interfaces. The controllers that call the services access them through these interfaces. Instantiation is done using the Ninject DI framework.
Now the actual question; who “owns” the interfaces? From my understanding of dependency inversion, the service interfaces would be owned by the controllers and therefore reside in that assembly.
None of your components have to own the interfaces. Good interfaces are their own animal – they just have to be visible to both the controllers and services.
Physically segregating them creates headaches that may be unnecessary – I recommend that you do not use multiple assemblies without a good reason.