Download presentation
Presentation is loading. Please wait.
2
Josh Twist Principal Consultant, Microsoft UK www.thejoyofcode.com jtwist@microsoft.com @joshtwist
3
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
4
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
5
Dependency Injection (DI) and Inversion of Control (IoC) Containers The Managed Extensibility Framework
6
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 ();
7
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)
8
Very similar, it has – A container – Catalogs – Strategic build up of dependencies But the focus is different…
11
Power Station
13
Plug
15
Kettle
16
At last, some code
17
Versioning (both the contracts and the applets) Security (regrettably mostly overlooked in this session) Memory management
18
jtwist@microsoft.com @joshtwist www.thejoyofcode.com
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.