The Managed Extensibility Framework (MEF) is a new library in Silverlight 4. MEF enables you to build modularized applications whose components can be added in an incrementally. MEF ships as part of Silverlight 4, but we’ve also made a Silverlight 3 compatible version of MEF available on codeplex at MEF.Codeplex.com (current version: Preview 8). Read this post!
I have create my sample application (VS solution: MEF). There’ are excellent showcasts prepared by Mike Taulty. They show many MEF features. I have make VS solution (MEF2) with almost all presented cases.
MEF features in these 2 solutions:
- Exports ([Export])
- Composable Part, properties, methods (as delegates)
- Export metadata ([ExportMetadata(key, value)])
- Custom Export Attributes ([Custom]: [Export])
- Inheritance ([InheritedExport])
- Life time (option: [PartCreationPolicy]: Any, Shared, Nonshared)
- Imports ([Import])
- Properties, constructor parameters ([ImportingConstructor]), fields, collections ([ImportMany]), methods (as delegates)
- Parameter imports (Implied import - type of parameter (by default), Explicit import - contract)
- Importing Metadata
- Requirement ([Import] option: AllowDefault)
- Recomposition (option: AllowRecomposition)
- Notifications (IPartImportsSatisfactionNotification)
- Rejection (Stable Composition)
- Lazy imports (Lazy<T>)
- Dynamic Instantiation (PartCreator<T>)
- Composition & hosting
- Part Initializer (PartInitializer.SatisfyImports)
- Catalogs (AssemblyCatalog, .NET: DirectoryCatalog / Silverlight: PackageCatalog, TypeCatalog, AggregateCatalog)
- Containers (CompositionContainer, CompositionHost.InitializeContainer)
- Export Providers (CatalogExportProvider, AggregateExportProvider)
- Silverlight 4 Beta Toolkit: Dynamic XAP downloading (PackageCatalog, Package.DownloadPackageAsync)
On the Internet there are many interesting samples with MEF and Silverlight 3 or 4 Beta. For example:
HauseSpacePlanner (PDC 09)
ExtensibleGrid (Sample in MEF sources, PDC 09)
Silverlight 3 Navigation with MEF (Brad Abrams)
Useful links
- http://microsoftpdc.com/Sessions/FT24
- http://blogs.msdn.com/gblock/
- http://blogs.msdn.com/gblock/archive/2009/11/29/mef-has-landed-in-silverlight-4-we-come-in-the-name-of-extensibility.aspx
- http://blogs.msdn.com/gblock/archive/2009/11/30/building-the-hello-mef-dashboard-in-silverlight-4-part-i.aspx
- http://blogs.msdn.com/gblock/archive/2009/12/05/building-hello-mef-part-ii-metadata-and-why-being-lazy-is-a-good-thing.aspx
- http://blogs.msdn.com/gblock/archive/2009/12/15/building-hello-mef-part-iii-xap-partitioning-with-the-host-s-permission-and-the-sweetness-of-recomposition.aspx
- http://blogs.msdn.com/gblock/archive/2009/08/16/should-i-use-mef-for-my-general-ioc-needs.aspx
- http://blogs.msdn.com/gblock/archive/2009/11/01/should-i-use-mef-with-an-ioc-container-part-1.aspx
- http://blogs.msdn.com/gblock/archive/2009/12/02/mef-and-prism-to-be-or-not-to-be.aspx
- http://blogs.msdn.com/gblock/archive/2010/01/03/mef-and-prism-exploration-mef-module-loading.aspx
- http://mtaulty.com/
- http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2009/11/18/silverlight-4-rough-notes-managed-extensibility-framework.aspx
- http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2009/12/31/silverlight-4-screencasts-the-managed-extensibility-framework-mef.aspx
- http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2010/01/04/silverlight-4-beta-more-on-mef-and-the-packagecatalog.aspx
- http://mef.codeplex.com/
- http://silverlight.net/learn/videos/all/using-mef-silverlight-4-extensibility/
- http://development-guides.silverbaylabs.org/Video/Silverlight-MEF
- http://channel9.msdn.com/learn/courses/Silverlight4/Overview/Overview/
- http://channel9.msdn.com/shows/10-4/10-4-Episode-26-Creating-Extensible-Applications-with-the-Managed-Extensibility-Framework/
- http://blogs.msdn.com/brada/
- http://blogs.msdn.com/brada/archive/2008/09/29/simple-introduction-to-composite-applications-with-the-managed-extensions-framework.aspx
- http://blogs.msdn.com/brada/archive/2009/07/13/managed-extensibility-framework-mef-preview-6-silverlight-support-and-much-more.aspx
- http://blogs.msdn.com/brada/archive/2009/07/20/simple-example-using-managed-extensibility-framework-in-silverlight.aspx
- http://blogs.msdn.com/brada/archive/2009/07/31/silverlight-3-navigation-dynamically-loaded-pages-now-mef-powered.aspx
- http://blogs.msdn.com/nblumhardt/
- http://blogs.msdn.com/dsplaisted/
- http://denisvuyka.wordpress.com/
- http://blogs.silverlight.net/blogs/jesseliberty/archive/2009/12/08/mef-silverlight-and-the-hvp.aspx
- http://ayende.com/Blog/archive/2008/09/25/the-managed-extensibility-framework.aspx
- http://www.sidarok.com/web/blog/content/2008/09/26/what-is-this-managed-extensibility-framework-thing-all-about.html
No comments:
Post a Comment