Presentation is loading. Please wait.

Presentation is loading. Please wait.

Josh Twist Principal Consultant, Microsoft UK

Similar presentations


Presentation on theme: "Josh Twist Principal Consultant, Microsoft UK"— Presentation transcript:

1

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…

9

10

11 Power Station

12

13 Plug

14

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


Download ppt "Josh Twist Principal Consultant, Microsoft UK"

Similar presentations


Ads by Google