Using an IoC framework like Autofac is a powerful way to implement SOLID principles. From making unit testing and code organization easier, the advantages should need little or no explanation or justification.
In retrospect, the Autofac setup and functionality is great. If you usually get giddy about clean short code, it’s just magical. Autofac does a lot of the gluing for us behind the scenes which theoretically works 100% of the time but what happens when a project grows over time. Do the old registrations still work? Do new registrations step on old ones? Are there classes that match some registration they really shouldn’t?
Let’s take for example the following. It’s perfectly valid code but can make life a bit difficult.
Assuming we have an MVC application and register all classes that end on “Provider” as AsImplementedInterfaces.
That’s a reasonable thing to do so we can inject providers into our…
View original post 406 more words