1 / 12

Experiment: Building an AppMarket using The MEF and .NET 4

Experiment: Building an AppMarket using The MEF and .NET 4. Josh Twist Principal Consultant, Microsoft UK www.thejoyofcode.com jtwist@microsoft.com @ joshtwist. About this session. Focus is The MEF Not aiming to cover all the features but apply it to a scenario

casey
Download Presentation

Experiment: Building an AppMarket using The MEF and .NET 4

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. Experiment: Building an AppMarket using The MEF and .NET 4 Josh Twist Principal Consultant, Microsoft UK www.thejoyofcode.com jtwist@microsoft.com@joshtwist

  2. About this session • Focus is The MEF • Not aiming to cover all the features but apply it to a scenario • Heaps to get through so need some Blue Peter ingredients

  3. The experiment • Build an extensible application that can download and run ‘applets’. • Allow the applets to leverage optional services • Create a service that makes applets discoverable with the minimum amount of code

  4. Primers • Dependency Injection (DI) and Inversion of Control (IoC) Containers • The Managed Extensibility Framework

  5. DI/IoC Containers • About the removal of concrete dependencies • Using abstract types (ideally interfaces) • The Container is the FooMaker • Most containers are typically configured via code or XML Foofoo = new Foo(); IFoofoo = FooMaker.GetFoo(); IFoo foo = Container.Resolve<IFoo>(); Container.RegisterType<IFoo, Foo>(); <TypeMapping From="IFoo" To="Foo" />

  6. DI/IoC Containers • Type are registered in a catalog(ue) • But, what if Foo depends on IBar? //constructorpublic Foo(IBar bar)

  7. The MEF • Very similar, it has • A container • Catalogs • Strategic build up of dependencies • But the focus is different… It’s all about runtime discovery baby!

  8. Experiment: the Shell {Binding Applets} {Binding LaunchCommand} {Binding CurrentApplet} {Binding HomeCommand} Home

  9. What’s this?

  10. Plug

  11. At last, some code Let the DEMO begin

  12. jtwist@microsoft.com @joshtwist www.thejoyofcode.com Thank you

More Related