Create Silverlight Apps Using Plug-in Components

blocksApplication requirements change frequently and software is constantly evolving. As a result, such applications often become monolithic making it difficult to add new functionality. Managed Extensibility Framework (MEF) is a new library in .NET Framework 4.0 that addresses this problem by simplifying the design of extensible applications and components.

Reusable Components

MEF presents a simple solution for the runtime extensibility problem. Until now, any application that wanted to support a plugin model needed to create its own infrastructure from scratch.

Those plugins would often be application-specific and could not be reused across multiple implementations.

  • MEF provides a standard way for the host application to expose itself and consume external extensions. Extensions, by their nature, can be reused amongst different applications. However, an extension could still be implemented in a way that is application-specific. Extensions themselves can depend on one another and MEF will make sure they are wired together in the correct order (another thing you won't have to worry about).
  • MEF offers a set of discovery approaches for your application to locate and load available extensions.
  • MEF allows tagging extensions with additional metadata which facilitates rich querying and filtering.

New Silverlight API for MEF

And now, you can use MEF with Silverlight. In Silverlight we've introduced a new api called System.ComponentModel.Composition.CompositionInitializer. CompositionInitializer allows parts to get composed by MEF without having to do any manual bootstrapping as it will automatically configure MEF on demand.

This means you can use it anywhere within your Silverlight application.

For more information about MEF, see Welcome to the MEF community site. For information about how to incorporate MEF in Silverlight, see Silverlight-specific functionality in the MEF Guide.

Series of Screencasts on Channel 9
Online Lab


Bruce D. Kyle
ISV Architect Evangelist | Microsoft Corporation

cid:image010.png@01C9DEED.1FDB2200 cid:image011.png@01C9DEED.1FDB2200 cid:image012.gif@01C9DEED.1FDB2200 channel9

Add to Technorati Favorites

Bookmark and Share

Comments (0)

Skip to main content