Wednesday, 21 April 2010

MEF Managed Extensibility Framework - Resources

Note: The aim of this document is to gather information and resources, it is a living document, so feel free to add comments to add or update.. Content is extracted from sources, so I am just collecting information for everybody's reference. I will probably end up putting this in a wiki / codeplex but for administration is easier to start here.


Extensibility is a key design point for many applications such as the Microsoft Office applications with their plug-in model for extensibility. Silverlight 4 ships with a new framework, the Managed Extensibility Framework (MEF), which provides a flexible way of building extensibility into your applications with capabilities for discovering and composing extensions at run-time in a dynamic and loosely-coupled way.

MEF can be found in .Net 4, Silverlight 4 and for Silverlight 3 in codeplex


For an introduction of MEF you can start with this Presentation / Demo of Mike Taulty

In this demo-based session he takes a tour around MEF and look at its capabilities for building extensibility into your applications and also how it can be used in implementing the Model-View-ViewModel (MVVM) pattern in Silverlight applications.

So why use MEF

Ten Reasons to use the Managed Extensibility Framework

Learning MEF

You can find in Channel 9 a video series to learn MEF, created also by Mike Taulty

The video series include:

You can take an step further and in this video Glenn Bloc shows how to use MEF to load and unload XAP files on demand.

Silverlight TV 11: Dynamically Loading XAPs with MEF

If you want to understand what is going on in the Framework you can also use the Mef Visualizer


In you will find in the source code plenty samples to start with.

Supporting Frameworks

MEF Contrib

In the MEF Contrib project you will find: A generic Catalog, Unity integration (this can become very handy if you are using PRISM), and Programming Models like Provider Model and Convention Model. You can read more in the Documentation and Features section.


So what is the deal with PRISM and MEF? In PRISM 4 there will be full support / guidelines for MEF, you can read about here and here in the blogs of Glenn Bloc and Davil Hill.

In these blogs Jeremy Likness describes a good way to start on how to glue everything together

Or it also describes how you can use MEF instead of PRISM


There is another alternative to PRISM, you can use Caliburn as your framework of choice, which includes already MEF support.

Here is the current adapter source code.

No comments: