Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dependency Injection with MEF and Unity

Similar presentations


Presentation on theme: "Dependency Injection with MEF and Unity"— Presentation transcript:

1 Dependency Injection with MEF and Unity
Pavel Yosifovich Hi-Tech College

2 Agenda Why MEF? MEF Features Why Unity? Unity Features Q & A Summary

3 MEF Basics DEMO

4 MEF Basics Parts Catalog Container Export and Import A list of parts
The matchmaker Composition MEF Part Export Import MEF Part Export Import

5 MEF Basics - Catalogs AggregateCatalog DirectoryCatalog
AssemblyCatalog TypeCatalog

6 MEF Features DEMO

7 More MEF Features [ImportingConstructor] [ImportMany] Creation Policy
AllowDefault=true Re-composition Metadata

8 MEF - Summary MEF is about extensibility through composition
Dependency Injection capabilities Not a true IoC container Part of .NET 4 MEF for Silverlight 4 Mostly similar, some Silverlight specific features( e.g. DeploymentCatalog)

9 Basic Unity DEMO

10 Unity Basics A true IoC container Registering types
Resolving and injecting dependencies Configuration

11 More Unity Features DEMO

12 More Unity Features Lifetime management Hierarchical containers
Aspect Oriented Programming (AOP) Interception

13 Questions?

14 Summary MEF is an extensibility framework Unity is an IoC container
Exports & Imports Metadata and Re-composition Unity is an IoC container Type resolution Interception (AOP) Both provide Dependency Injection

15 Resources MEF on CodePlex Unity on CodePlex
Unity on CodePlex Microsoft Patterns & Practices

16 משובים ופייסבוק מירב- השלמה

17

18


Download ppt "Dependency Injection with MEF and Unity"

Similar presentations


Ads by Google