UvodDoKomponent: MEF |
from Wiki KIVu |
The Managed Extensibility Framework (MEF) is a composition layer for .NET that improves the flexibility, maintainability and testability of large applications. MEF can be used for third-party plugin extensibility, or it can bring the benefits of a loosely-coupled plugin-like architecture to regular applications (MEF support a Plugin Model).
System.ComponentModel.Composition.*
which has shipped with .NET 4.0 and higher and Silverlight 4. This provides the standard extension model that has been used in Visual Studio.
System.Compostion.*
is a lightweight version of MEF, which has been optimized for static composition scenarios and provides faster compositions. It is also the only version of MEF that is as a portable class library and can be used on phone, store, desktop and web applications.
Roughly speaking, MEF's core is comprised of a catalog and a CompositionContainer?. A catalog is responsible for discovering extensions and the container coordinates creation and satisfies dependencies.
External *Codeproject* site!
MEF as seen on Fig. below, is divided into three main layers Container, Primitives and Attributed Programing Model. Each of these parts is described in Full MEF Architecture here.
Are you interested to know more about MEF (e.g. "MEF vs standard IoC Container", "MEF Visualizer", "Why to use MEF", "More learing materials" etc.) click here .
Parking lot example writen in C# without using MEF ParkovistePlain. Implementation Attach:ParkingLot_Plain.zip
Parking lot example writen in C# using MEF Dependency Injection ParkovisteMEF. Implementation Attach:ParkingLot_MEF.zip