1 / 37

Building Extensible Rich Internet Applications with the Managed Extensibility Framework

Building Extensible Rich Internet Applications with the Managed Extensibility Framework. Glenn Block Program Manager Microsoft Corporation. What we’ll cover. RIA Extensions, add-ins , and plugins oh my!. Extensibility implants. Turning fat apps into slimmer apps. Reality. RIA 1.0.

latona
Download Presentation

Building Extensible Rich Internet Applications with the Managed Extensibility Framework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Building Extensible Rich Internet Applications with the Managed Extensibility Framework Glenn Block Program Manager Microsoft Corporation

  2. What we’ll cover

  3. RIA Extensions, add-ins, and plugins oh my!

  4. Extensibility implants

  5. Turning fat apps into slimmer apps

  6. Reality RIA 1.0

  7. We need….. Reality We need….. We need….. We need….. K We need….. F A E We need….. J I D RIA 1.0 C B H G We need….. We need….. We need…. We need….

  8. Managed Extensibility Framework The Managed Extensibility Framework (MEF) is a new library in Silverlight 4 for building applications that can be incrementally extended. • For customers • For you and your team • Always there, always ready

  9. MEF Basics… An Application is built ofparts.

  10. Hello MEF in Silverlight Demo

  11. MEF Basics… Export it. Import it. Composeit.

  12. Export it. [Export(typeof(UserControl))] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } } Widget1 UserControl Export

  13. Import it. [Export(typeof(UserControl))] public class Widget1 : UserControl { [Import] public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } } Widget1 String Import

  14. Import it. [Export(typeof(UserControl))] public class Widget1 : UserControl { [Import(“HelloMEF.Message”)] public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } } Widget1 “HelloMEF.Message” Import

  15. Import it. [Export(typeof(UserControl))] public class MainPage: UserControl { [ImportMany(typeof(UserControl))] public IEnumerable<UserControl> { get;set; } } Main Page UserControl ImportMany

  16. Compose it. PartIntializer: “Compose yourself” public MainPage() { InitializeComponent(); PartInitializer.SatisfyImports(this); } MainPage Compose

  17. Be different – Use metadata

  18. Where does the widget go? Widget Widget

  19. Export it - Metadata [ExportMetadata(“Location”,Location.Top)] [Export(typeof(UserControl))] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } } Widget1 Put me in the top UserControl Export

  20. Import it - Metadata [Export(typeof(UserControl))] public class MainPage: UserControl { [ImportMany(typeof(UserControl))] public IEnumerable<Lazy<UserControl, IWidgetMetadata> { get;set; } } Main Page UserControl ImportMany

  21. Have it your way! – Custom Exports

  22. Export it - Metadata [ExportMetadata(“Location”,Location.Top)] [Export(typeof(UserControl))] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } } Widget1 Put me in the top UserControl Export

  23. Customize it – Custom exports [Widget(Location=Location.Top)] public class Widget1 : UserControl { public string Message { get{return(string) Button.Content;} set{Button.Content=value;} } } Widget1 Put me in the top UserControl Export

  24. Putting it all together Demo

  25. Trim up your apps break up your XAPs Demo

  26. MEF and Prism partner Ariel Ben-Horesh arielb@sela.co.il blogs.microsoft.co.il/blogs/arielbh Developer Sela Group

  27. Introducing MEF-Prism integration • Our Goal : Enable an existing Prism application to be further extended through MEF • Enabled MEF modules to be added dynamically on the fly. • Enable MEF discovered components to be registered in IoC container (Such as Unity).

  28. Introducing MEF-Prism integration • Prism application starts and loads up known modules. Module Loader

  29. Introducing MEF-Prism integration • Prism application can load unknownplugins, by using MEF as an abstraction layer. • 1. Plugins are located and added to a MEF catalog. Server

  30. Introducing MEF-Prism integration • Prism application can load unknownplugins, by using MEF as an abstraction layer. • 2. Plugins register dependencies with current IoC container. Server

  31. Introducing MEF-Prism integration • Prism application can load unknownplugins, by using MEF as an abstraction layer. • 3. Plugins are activated. Dependencies are injected. Server

  32. Where can I get it? • MEF ships in Silverlight 4.0 • Dynamic XAP support in SL 4.0 Toolkit • Silverlight 3.0 support on Codeplex • MEF source ships under MSPL Learn more: Silverlight.net MEF.Codeplex.com MEFContrib.Codeplex.com – Prism/MEF blogs.msdn.com/gblock

  33. MEF Cross-platform(s) partner Jackson Harper jackson@novell.com blog.MonoOnTheWeb.info Software Engineer Moonlight Project

  34. YOUR FEEDBACK IS IMPORTANT TO US! Please fill out session evaluation forms online at MicrosoftPDC.com

  35. Learn More On Channel 9 • Expand your PDC experience through Channel 9 • Explore videos, hands-on labs, sample code and demos through the new Channel 9 training courses channel9.msdn.com/learn Built by Developers for Developers….

More Related