Creating Dynamic Applications

Prior to MEF, the work required to create a so-called open-ended .NET application (that is, an application that allows others to contribute code and alter or add to its functionality) was far from a trivial effort. The main issue here is one of discovery and instantiation. The “host” application (the application that supports extensions) needs to have a standard way of identifying and validating code meant to extend the host. And there needs to be a runtime activation approach: how is the plug-in code executed, and what portions of the host app can be affected by the plug-in?

This is where MEF enters the scene. It provides an architecture pattern and framework/API that host application developers and plug-in developers can use to enable these dynamic application scenarios.

In fact, MEF explicitly targets developers who are creating any of three different classes of applications:

Image Extensions—Chunks of compiled code that enhance the functionality of an existing application. Extension developers need to be able to implement their components without having access to the host applications’ source or even specialized knowledge of that source.

Image Extensible frameworks/host applications—Applications that need to support the dynamic addition of functionality via extensions.

Image Programming model—The least common scenario; in this case, a developer is interested in creating a potentially new way of developing against an application platform. In this case, MEF can provide the building blocks that developers need to build their own extensible application platform.

Visual Studio is merely one example of a host application that clearly benefits from its ability to support rich add-ins that add value to the core feature areas that Microsoft delivers out of the box.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset