Introduction to MEF (managed extensibility Framework)

Source: Internet
Author: User

1. What is MEF?

MEF is a new framework from Microsoft's collaborative construction of extended applications. It aims to add plug-ins to running applications. MEF inherits from the. Net 4.0 Framework Platform and exists in system programs of various application platforms.

2. Assembly

System. componentmodel. Composition. dll

3. Key Structure

Import

Export

Compose

4. Related Knowledge

Part: an object that can be imported or exported to applications

Catalog: an object that helps you find valid building parts in an assembly or folder.

Contract: The Import and Export parts must be communicated through the contract.

Import attribte: defines the needs of a part. It applies a single export attriute

Importmany attribute: similar to the import attribute, but supports multiple export attriutes

Export attribute: You need to create and export when creating the import. It serves as a participant in the build plug-in.

Compose: integrate exported with import

5. In a simple example, only a single export part is used in the current Assembly.

6. In a simple example, multiple export parts are used in the current Assembly.

7. In a simple example, multiple export parts are used in the integration directory and folder directory.

Description: Code 5, 6, and 7: mefdemo.rar

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.