Microsoft Embraces Dependency Injection in the Framework
In order to reduce duplication across frameworks like WCF, WPF, and ASP.NET, Microsoft has formed the Application Framework Core team. The goal of this team is to prevent design issues like the different dependency property systems for WPF and WF.
One of their first projects is the Managed Extensibility Framework or MEF. This project will leverage techniques such as Naming and Activation Services, Dependency Injection, and Duck Typing. Much of the work underlying Microsoft's implementation is based on community feedback. Krzysztof Cwalina writes,
The direct engagement with the DI community is also starting. We gave a talk on the technology at last week’s MVP Summit, and talked with Jeremy Miller (the owner of Structure Map) and Ayende Rahien (Rhino Mocks) . We got lots of great feedback from Jeremy and Ayende and I think their experience in the DI space and their feedback will be invaluable as the project evolves. Thanks guys! We are of course also looking forward to engaging others in the DI community.
While still in the early phases, some early examples of the syntax are available. In .NET tradition, it is based on attributes rather than XML or explicit object passing.
And some popular open source DI frameworks:
Ninject (new but looks very impressive)
Spring.Net (port of the very successful and established Java framework)
MS has used DI for quite a while
ORM, DI, all of this stuff made popular in Java long long ago.
Where is Castle?
In my opinion I still cannot believe the way Microsoft treats extremely popular and successful Open Source Projects. It's all there guys, and we can embrace it NOW.
Re: Where is Castle?
Right now, I'm excited about Ninject. If you haven't looked at it, I recommend you do. In my opinion, if you all you want is an intuitive, usable IoC container, Ninject is far better than Spring.NET -- although I believe they're still working on the performance. I'd be very interested to hear your thoughts on Castle v Ninject also.
Mike Keane Dec 21, 2014
Jeremy Stieglitz Dec 21, 2014