Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Managed Extensibility Framework 2010 01

2 874 vues

Publié le

Publié dans : Technologie, Formation
  • Identifiez-vous pour voir les commentaires

Managed Extensibility Framework 2010 01

  1. 1. David Giard<br />MCTS, MCSD, MCSE, MCDBA<br />Principal Consultant, Sogeti<br />www.DavidGiard.com<br />DavidGiard@DavidGiard.com<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 />MEF.CodePlex.com <br />Download and unzip MEF_Beta_2.zip<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 />http://MEF.codeplex.com<br />http://www.davidgiard.com<br />http://msmvps.com/blogs/kathleen<br />http://blogs.msdn.com/gblock<br />http://tinyurl.com/TaultyMEFSilverlightVideos<br />NPlus1.org<br />David Giard, MCTS, MCSD, MCSE, MCDBA<br />www.DavidGiard.com<br />DavidGiard@DavidGiard.com<br />
  20. 20. User Groups<br />Great Lakes Area .Net User Group<br />Southfield, MI<br />migang.org<br />Greater Lansing .Net User Group<br />East Lansing, MI<br />glugnet.org<br />
  21. 21. Dave’s Thoughts<br />DavidGiard.com<br />TechnologyAndFriends.com<br />DavidGiard@DavidGiard.com<br />

×