Download presentation
Presentation is loading. Please wait.
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
משובים ופייסבוק מירב- השלמה
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.