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.

MEF

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 http://mef.codeplex.com/

Introduction

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.

http://channel9.msdn.com/posts/matthijs/Silverlight-4-A-Guided-Tour-of-the-Managed-Extensibility-Framework-MEF/

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

http://channel9.msdn.com/tags/learnMEFSL4/

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 http://mefvisualizer.codeplex.com/ Mef Visualizer

Samples

In http://mef.codeplex.com/ you will find in the source code plenty samples to start with.



Supporting Frameworks

MEF Contrib

http://mefcontrib.codeplex.com/

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.


PRISM and MEF

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

Caliburn

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: