Is IoC containers harmful for DDD?
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
I was reading Growing Object-Oriented Software book and came across this article Dependency Injection harmful http://www.natpryce.com/articles/000783.html by Nat Pryce. I had hard time understanding what Nat is talking in that article. Is he talking about not using the word dependency injection or not using a IoC container to achieve the DI? I have used Microsoft Unity and MEF before, and they are very convenient in building up the objects. MEF is extremely useful where the parts can be discovered automatically. For example, the core domain depends on pricing service which can be switched to any implementation through Unity as well as MEF. With MEF, just dropping a dll is enough for the domain to pick up the new implementation. Without a IoC or MEF, it would require a lot of code to inject a dependency.