4 ms·
Why do you consider them a fad? I've found it immensely useful to not go through the rigamarole of newing up a ton of objects manually in my web controllers an
by rjbwork 11y ago
Why do you consider them a fad?
I've found it immensely useful to not go through the rigamarole of newing up a ton of objects manually in my web controllers and queue/batch processing frameworks. Just choose your composition roots properly and you can easily add new endpoints/jobs/event processors without all the worry of resolving all the dependencies manually.
It also allows you to reduce footprints (setting non-stateful code/configuration objects as singletons), transparently cache and instrument(dynamic proxies, or application specific caching/logging wrappers), and other similar application-level concerns without it infecting consuming code or otherwise independent modules.
- guiomie 11y agoBy fad, I meant that the frameworks change in the world of IoC, while DI is pretty much a concept easily applicable in OO languages. I myself and my team use AutoFac right now, but who knows what it could be in 1-2 years...