The Managed Extensibility Framework (MEF)

By DimitriC at June 30, 2010 13:34
Filed Under: Microsoft, Programming, tools & Utilities

Microsoft's Managed Extensibility Framework provides a way to build very modular solutions. See it as a plug-in system where you have a shell which dynamically loads parts. A part is a functionality (or a set of functionalities). It is included in Visual Studio 2010 and Silverlight 4. For thos who are still working with Visual Studio 2008/2005, MEF is available as downloadable package (see links below).

 

MEF presents a simple solution for the runtime extensibility problem. Until now, any application that wanted to support a plugin model needed to create its own infrastructure from scratch. Those plugins would often be application-specific and could not be reused across multiple implementations.

- MEF provides a standard way for the host application to expose itself and consume external extensions. Extensions, by their nature, can be reused amongst different applications. However, an extension could still be implemented in a way that is application-specific. Extensions themselves can depend on one another and MEF will make sure they are wired together in the correct order (another thing you won't have to worry about).
- MEF offers a set of discovery approaches for your application to locate and load available extensions.
- MEF allows tagging extensions with additonal metadata which facilitates rich querying and filtering

 source

 

References:

The MEF project site (CodePlex) (includes webcasts)
Practical examples of products and solutions that use MEF
MEF Programming Guide
MEF Architecture

 

Comments are closed