BT

InfoQ Homepage News Microsoft Embraces Dependency Injection in the Framework

Microsoft Embraces Dependency Injection in the Framework

Bookmarks

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.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • Other Resources

    by Al Tenhundfeld /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    If you're interested in this topic, I'd also read the earlier interview on Unity. www.infoq.com/news/2008/04/microsoft-unity



    And some popular open source DI frameworks:

    Ninject (new but looks very impressive)

    ninject.org/



    Spring.Net (port of the very successful and established Java framework)

    www.springframework.net/

  • MS has used DI for quite a while

    by Jim Leonardo /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    MS has used DI as the core for configurability of the Enterprise Library for a long time now, so the real news here is that they're finally making it a focus for a product team rather than just the patterns and practices team. What's good to hear is the engagement with others.

  • ORM, DI, all of this stuff made popular in Java long long ago.

    by serge ---- /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    A technique that has long existed in the java world and has been the norm for some time now.

  • Where is Castle?

    by F Quednau /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Should it not at least get honorable mention? www.castleproject.org/container/index.html

    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?

    by Al Tenhundfeld /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Why would you recommend Windsor Castle over Spring.NET? I have heard good things about Castle, but I've not taken the time to sit down and play with it.



    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.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.