Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Managed Extensibility Framework 2010 01


Published on

Published in: Technology, Education
  • Login to see the comments

Managed Extensibility Framework 2010 01

  1. 1. David Giard<br />MCTS, MCSD, MCSE, MCDBA<br />Principal Consultant, Sogeti<br /><br /><br />
  2. 2. Managed Extensibility Framework<br />Beta 2<br />
  3. 3. Compile and Deploy<br />Tight Coupling<br />DLL<br />DLL<br />EXE<br />
  4. 4. MEF<br />Loose Coupling with mef<br />Compile and Deploy<br />DLL<br />DLL<br />EXE<br />DLL<br />Contract<br />Contract<br />Contract<br />Contract<br />
  5. 5. Managed Extensibility Framework<br />Applications consists of loosely-coupled components that are discovered and composed at runtime<br />
  6. 6. Advantages of mef<br />Loose Coupling<br />Swap Classes at Runtime<br />No Recompile or Redeploy<br />Single Plug-In Architecture<br />
  7. 7. MEF Usage Scenarios<br />Empower developers to extend your application without modifying it<br />Provide extra modules to your application, as needed<br />Use MEF as an platform ecosystem to manage all parts of your application<br />
  8. 8. Demo<br />G/L<br />Modules for Accounting app<br />A/R<br />MEFApp<br />(Accounting)<br />GenSetup<br />A/P<br />Export<br />
  9. 9. Existing Extensibility in .Net<br />Visual Studio Add-Ins<br />Microsoft Tools for Office<br />Rules Engines<br />WCF<br />Interfaces<br />Reflection<br />IOC / Dependency Injection<br />
  10. 10. Get Started<br /> <br />Download and unzip<br />Zip file contains<br />DLLs<br />Samples<br />Source Code<br />
  11. 11. Developer Steps<br />Set Reference to System.ComponentModel.Composition.dll<br />Contract<br />Import<br />Export<br />Catalogs<br />Composition<br />Import<br />Contracts<br />Export<br />
  12. 12. MEF<br />Contracts<br />[Import(“Contract1”)]<br />String SomeThing {get; set;}<br />[Export(“Contract1”)]<br />Public string SpecialThing{<br />Get {return “A Value”};<br />}<br />“A Value”<br />
  13. 13. MEF<br />Contracts<br />[Import(“Contract1”)]<br />String SomeThing {get; set;}<br />[Export(“Contract1”)]<br />Public string MoreSpecialThing{<br />Get {return “A Different Value”};<br />}<br />“A Different Value”<br />
  14. 14. MEF<br />Interface Contracts<br />[Import(typeof(IFoo))]<br />IFooSomeFoo {get; set;}<br />[Export(typeof(IFoo))]<br />public Foo: IFoo{<br />…<br />}<br />new Foo()<br />
  15. 15. MEF<br />Interface Contracts<br />[Export(typeof(IFoo))]<br />public Foo1: IFoo{<br />…<br />}<br />[ImportMany(typeof(IFoo))]<br />List&lt;IFoo&gt; BunchOfFoos{get; set;}<br />new Foo1()<br />[Export(typeof(IFoo))]<br />public Foo2: IFoo{<br />…<br />}<br />new Foo2()<br />
  16. 16. Composition<br />varcatalog1 = newDirectoryCatalog(@&quot;c:MEFImports&quot;);<br />var container = newCompositionContainer<br />catalog1);<br />container.ComposeParts(this);<br />Catalogs<br />TypeCatalog<br />AssemblyCatalog<br />DirectoryCatalog<br />AggregateCatalog<br />PackageCatalog (Silverlight toolkit)<br />
  17. 17. Demo<br />Using MEF<br />
  18. 18. MEF vs Dependency Injection<br />
  19. 19. rESOURCES<br /><br /><br /><br /><br /><br /><br />David Giard, MCTS, MCSD, MCSE, MCDBA<br /><br /><br />
  20. 20. User Groups<br />Great Lakes Area .Net User Group<br />Southfield, MI<br /><br />Greater Lansing .Net User Group<br />East Lansing, MI<br /><br />
  21. 21. Dave’s Thoughts<br /><br /><br /><br />