Josh Twist Principal Consultant, Microsoft UK
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
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
Dependency Injection (DI) and Inversion of Control (IoC) Containers The Managed Extensibility Framework
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 Foo foo = new Foo(); IFoo foo = FooMaker.GetFoo(); IFoo foo = Container.Resolve (); Container.RegisterType ();
Type are registered in a catalog(ue) But, what if Foo depends on IBar? FromTo Fabricam.Contracts.IFooFabricam.Fubar.Foo Fabricam.Contracts.IBarFabricam.Fubar.Bar Fabricam.Common.ILoggerContoso.Log4NetLogger Fabricam.AppMarket.IAppletContoso.Fakebook //constructor public Foo(IBar bar)
Very similar, it has – A container – Catalogs – Strategic build up of dependencies But the focus is different…
Power Station
Plug
Kettle
At last, some code
Versioning (both the contracts and the applets) Security (regrettably mostly overlooked in this session) Memory management
@joshtwist