Managed Extensibility Framework

Source: Wikipedia, the free encyclopedia.
Managed Extensibility Framework
Developer(s)Microsoft
Stable release
V1 in .NET Framework 4.0 / April 12, 2010; 15 years ago (2010-04-12)
Preview release
V2 Preview 5 / December 19, 2011; 13 years ago (2011-12-19)
Web application framework
LicenseMIT License[1]
Websitedocs.microsoft.com/en-us/dotnet/framework/mef/

Managed Extensibility Framework (MEF) is a component of

generic types and the introduction of a convention-based extension model.[4]

Overview

MEF aims to solve the runtime extensibility problem. Without MEF, any application that wants to support a plugin model needs to create its own infrastructure from scratch. Those plugins will often be application-specific and cannot be reused across multiple implementations.

  • MEF aims to provide a standard way for the host application to expose itself and consume external extensions. Extensions, by their nature, could be reused amongst different applications. However, an extension can still be implemented in a way that is application-specific. Extensions themselves can depend on one another and MEF aims to make sure they are wired together in the correct order, sparing the developer from doing it manually.
  • MEF offers a set of discovery approaches for the application to locate and load available extensions.
  • MEF allows tagging extensions with additional metadata which aims to facilitate rich querying and filtering.

Design

Roughly speaking, MEF's core consists of a catalog and a CompositionContainer. A catalog is responsible for discovering extensions and the container coordinates creation and satisfies dependencies.

References

  1. ^ "MEF". GitHub. 15 October 2021.
  2. ^ Kanjilal, Joydip (7 July 2016). "How to work with the Managed Extensibility Framework in C#". InfoWorld. Retrieved 25 June 2022.
  3. ^ Pronschinske, Mitch (12 April 2010). "What's New in VS2010 and .Net 4?". DZone. Retrieved 25 June 2022.
  4. ^ Vogel, Eric (12 February 2010). "Managed Extensibility Framework Improvements in .NET 4.5". VisualStudio Magazine. Retrieved 25 June 2022.

Further reading