Skip to content

What is MEF

gstaas edited this page Oct 22, 2014 · 3 revisions

Microsoft's Managed Extensibility Framework (MEF) allows an application to easily add or remove components. A component is either an object or a C# type that is added to a special MEF container, so that the component can discover and use other components without having a hard-dependency between them.

Microsoft's MEF documentation calls these components extensions or parts; this guide and other ATF documents use the term component or MEF component if required for clarity.

ATF contains many components to easily provide capabilities common to many applications, so components are an integral part of ATF. Many of these components can be used independently of MEF. Some key components are outlined in Important ATF Components.

It is not in the scope of this guide to discuss MEF in depth, however, it does discuss How MEF is Used in ATF.

You do need to know the basics of MEF to understand how ATF employs it. To learn about MEF, see the following:

MEF Advantages

ATF uses MEF because its plugin architecture offers many advantages:

  • MEF provides a nice way to enable interdependent application components to discover each other at runtime.
  • MEF supports many scenarios, supports lazy loading, and has good support for circular dependencies.
  • MEF is non-intrusive: it does not require that you implement an interface or derive from a base class.
  • It is easy to port to MEF.
  • MEF is standard with the release of .NET 4.0 and later.

Topics in this section

Clone this wiki locally