Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

The recently announced managed extensibility framework (MEF) of .NET 4.0 - is it a dependency injection framework? Will Microsoft Unity from Patterns and Practices be obsolete in 4.0 ? How does MEF compare to a framework like Unity?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
452 views
Welcome To Ask or Share your Answers For Others

1 Answer

Specifically addressed in the PDC 2008 2nd Keynote by Scott Guthrie, MEF has a lot more to do with things like extending Visual Studio 2008 and other applications, without having to use all the COM and older technologies... A very good demonstration of extending the text edition in VS2008 was shown among other things. Start about an hour and 15 minutes into the 2nd day keynote (http://www.microsoftpdc.com) and you'll get direct information, but basically if you are going to "build an application with built in extensiblity points that can easily be discovered, and which supports discovery of extensions," then MEF is what you want. UNITY is what you want for a high-quality IoC container that does DI as well as the other solutions out there but has great and easy integration with the Enterprise Library.

Regarding Unity in the EL4.0 (now 4.1 -- http://msdn.microsoft.com/en-us/library/dd203099.aspx) its actually a IoC that sits on top of the version 2 ObjectBuilder and the EL4.1 has extensibility points for unifying the configuration of various EL application blocks with Unity.

MEF vs. Unity is like comparing apples to oranges. Some great and specific podcast/webcast(s) that describe UNITY in full are here, which I highly recommend:

DotNetRocks Show #393 http://www.dotnetrocks.com/default.aspx?showNum=393 DNR.tv Show #126 http://www.dnrtv.com/default.aspx?showNum=126


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...