10-4 Episode 26: Creating Extensible Applications with the Managed Extensibility Framework

Sign in to queue

Description

In this episode of 10-4, we take a look at a new library in .NET Framework 4 and how it helps developers write applications that are more extensible and easier to maintain than before.

For more information on the Managed Extensibility Framework, make sure to check out its home on Codeplex: http://www.codeplex.com/mef.

Source code for demo: http://cid-1b51ad25aad8fc86.skydrive.live.com/self.aspx/.Public/ManagedExtensibilityFramework.zip

For more 10-4 episodes, be sure to visit:
https://channel9.msdn.com/shows/10-4

10-4! Over and out!

Embed

Download

Download this episode

The Discussion

  • User profile image
    JoshRoss

    Nice intro!  I had a question, and I tried looking around the CodePlex documentation first, and did not find the answer.  

    This is more of a problem with my documentation reading skills than the authors document writing ability.

    Anyways, back to the question, if I have two or more equivalent exports, that have their imports satisfied, how is the import resolved? First in wins?  I think it has something to do with the catalog.

  • User profile image
    Remco Ros

    Very nice, especially the part about the NetworkCatalog.

    So you mention that the source is (will be?) available online. But I cannot find a link or attachment?

     

    Remco.

  • User profile image
    JoshRoss

    It was in the post comments... http://www.codeplex.com/mef

  • User profile image
    Remco Ros

    That's the MEF site. I mean the source from this presentation/example application. (or is this included in MEF Samples?)

  • User profile image
    JasonOlson

    Sorry for the delay! The code can be found at http://cid-1b51ad25aad8fc86.skydrive.live.com/self.aspx/.Public/ManagedExtensibilityFramework.zip

     

    Please let me know if that doesn't work!

  • User profile image
    JasonOlson

    In that situation, we will throw an error because we were expecting to only find one, and we found two. This is the only real "deterministic" way to behave for us.

  • User profile image
    Ray Jezek

    [Obsolete]

    System.AddIn

     

  • User profile image
    Visionsoft

    Very good explanation of MEF. I was looking into Spring.Net. How is MEF compared to Spring. Is it configurable using XML files or is it done through code.

     

    Why not Spring.Net?

     

    Just want to hear your take on it; I'm new to Dependency Injection.

     

    Thanks.

  • User profile image
    MariaMarcano

    Omg, this is very cool.. great episode..

     

    I was wondering if there are any performance implication when linking dependencies to all objects?

    Also, if you can talk more on further episodes about what other features like this will come in .net framework 4 that help us follow other best practices, patterns or SOLID principles easily.

     

    Again, great job!

     

    Thanks,

  • User profile image
    hoon1234

    Excellent. Simple and cool stuff to use in the real world.

  • User profile image
    santosh_b

    Spring is an IoC container while MEF is for plugins. An IoC is used when you know your dependencies at design time and typically deals with "one" dependency (for that area of the app) while MEF deals with many.

     

    For example, with IoC, at design/debug time you may inject a simple console logger for your app or even a mock logger while at production/runtime you will replace it with a proper logger that writes to a file or database but with MEF at runtime you are looking to discover "all loggers" that are available and call them (of course you can just pick up a single logger using the catalog) so your output can be piped to many.

     

    You could use MEF to wire dependencies like an IoC but it is not meant for or optimized for such behavior. MEF also has advantages with the way stuff is exported and imported in that it is not tied to types which means that your app can be opened up to plugins written in dynamically typed languages.

     

    HTH,

    Benjy

  • User profile image
    evanlarsen

    Favorite part:

     

    "Hey are you a plumber? can you satisfy my needs?"

     

    I LOL'd

  • User profile image
    Mike Crystal

    Great video, too bad the quality of the video made it imposible for me to read the code.

Add Your 2 Cents