InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Microsoft Embraces Dependency Injection in the Framework

Posted by Jonathan Allen on Apr 28, 2008

Sections
Process & Practices,
Development
Topics
Agile Techniques ,
.NET
Tags
Dependency Injection

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.

Other Resources by Al Tenhundfeld Posted
MS has used DI for quite a while by Jim Leonardo Posted
ORM, DI, all of this stuff made popular in Java long long ago. by serge boulay Posted
Where is Castle? by F Quednau Posted
Re: Where is Castle? by Al Tenhundfeld Posted
  1. Back to top

    Other Resources

    by Al Tenhundfeld

    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/

  2. Back to top

    MS has used DI for quite a while

    by Jim Leonardo

    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.

  3. Back to top

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

    by serge boulay

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

  4. Back to top

    Where is Castle?

    by F Quednau

    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.

  5. Back to top

    Re: Where is Castle?

    by Al Tenhundfeld

    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.

Educational Content

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.