I'm currently working on a large application (a hundred libraries, several thousands classes) with several entry points (MVC website, webservices, some background running agents, job schedulers...).
Most of those entry points use a non negligible part of the core services (I'd say around 50% at least).
I know from credible sources that composition roots should not be reused.
As much as I agree with the whole idea, in my particular case, each composition root has a lot (and I mean it) of duplicated code, and that seems kind of bad, as I know for a fact that most of the interfaces/impl bindings will stay the same whatever the entry point for at least some more time.
I could decide not to care, but this situation means that each time I want to add a new binding for a new class, I have to change maybe nine different composition roots.
In the end, I provided preconfigured composition roots parts directly in the projects holding the implementations (at least that does not change anything when it comes to loose coupling), so I just have to call them from the global composition roots when I need them, but this does not look like a right approach.
Does anyone has a better alternative ?