MEF Study Notes (1) -- What is MEF?

Source: Internet
Author: User

Http://mef.codeplex.com/wikipage? Title = overview & referringtitle = home)

 

What is MEF?

Managed extensibility framework (MEF) can easily construct scalable applications.Program. MEF provides discovery and combination capabilities, so you can choose to load the plug-in.

 

What problems does MEF solve?

    • MEF presents a simple extension problem during runtime. Until now, if you want to support the plug-in mode for any program, you need to build your own architecture. These plug-ins are often specific applications and cannot be reused by multiple implementations.
    • MEF provides a standard way for programs to expose themselves and consume external extensions. It is a natural extension that can be reused by different programs. However, an extension must implement a specific application. Extensions can depend on another extension, and MEF ensures that they are assembled at the same time in the correct order.
    • MEF allows additional metadata to mark extensions in queries and filtering.

 

How does MEF work?

    • Roughly speaking, the MEF core consists of a catalog (directory) and a compositioncontainer. A catalog is responsible for searching for extensions, and the container is responsible for coordinating creation and matching dependencies.
    • The first class of MEF is composablepart. A composable part provides one or more exports, or depends on one or more extensions provided by imports. A composable part can also be an object or a given type of instance. MEF, however, is an extensible, additional composablepart implementation that is attached to the import/export contract.
    • Both exports and imports have a contract ). Contract is a bridge between exports and imports. An export contract is composed of metadata used for filtering. For example, it can specify the capabilities provided by an export.
    • MEF containers interact with catalogs to access composable parts. The container solves some dependencies and exposes exports to the outside world. You can add composable part instances as needed.
    • A composablepart returns a catalog, which is very similar to an extension in your program. It has Imports Provided by the Host Program, and then export other.
    • By default, MEF composable part uses attribute metadata to declare exports and imports. This allows MEF to determine which parts, imports, and exports are completely available.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.