I have a set of applications that all use the same basic codebase -- a couple of ASP.NET web projects, some WCF services (running under ASP.NET), a few Windows services and a couple of executables. Most of them are even located in a single Visual Studio solution.
There's a lot of duplication between the various applications as far as injection is concerned. They generally need the same database connections, the same concrete objects, etc.
Because of the duplication, I have a single project called IoC that contains my StructureMap Registry. This is falling apart though as the application requirements diverge. Some applications do not need to be able to instantiate certain types. Further, this project is becoming a "God Assembly" of sorts with access to nearly every project in the solution.
What's the cleanest way to partition StructureMap injection to provide:
- Zero code duplication
- Local variation on a per-project basis
?