How to Explain Autofac Modules & Code Organization For Newbies
I've been writing a little bit about Autofac and why it's rad, but today I want to talk about Autofac modules. In my previous post on this, I talk about one of drawbacks to the constructor dependency pattern is that at some point in your application, generally in the entry point, you get allllll of this spaghetti code that is the setup for your code base. Essentially, we've balanced having nice clean testable classes with having a really messy spot in the code. But it's only ONE spot and the rest of your code is nice. So it's a decent trade off. But we can do better than that, can't we? What are Autofac Modules? We can use Autofac modules to organize some of the code that we have in our entry point into logical groupings. So an Autofac module…