Presentation is loading. Please wait.

Presentation is loading. Please wait.

What the heck is MEF? And why should I care? Jason Offutt Software Engineer Central Christian Church

Similar presentations


Presentation on theme: "What the heck is MEF? And why should I care? Jason Offutt Software Engineer Central Christian Church"— Presentation transcript:

1 What the heck is MEF? And why should I care? Jason Offutt Software Engineer Central Christian Church Email: jason.offutt@cccev.com Twitter: @JasonOffutt #RefreshCache

2 Managed Extensibility Framework Originally an Open Source project started by Microsoft developers (mef.codeplex.com)mef.codeplex.com Now comes baked into.NET 4.0  Included in System.ComponentModel.Composition

3 And I should care because? It allows us to make our code more like Legos  Modular & pluggable  Encapsulated functionality  Not dependent on other components

4 So what can MEF do? Act as an IoC container Manage dependency injection without tons of configuration Plays match-maker for your code “You use MEF to manage a set of unknown things. You use IoC containers to mange a set of known things.” – Glenn Block (MEF project manager)

5 How can Arena benefit from MEF? MEF can simplify the way we do dependency injection  Less code to maintain!  No need for configuration in web.config or Arena Org Settings and Lookups  MEF will dynamically load the correct object based on the contract/interface declared at runtime  Allows for lazy-loading objects to delay expensive database calls

6 How can Arena benefit from MEF? Allows us to keep our components very loosely coupled Makes it easier to write testable code  Less energy required to engineer our own “seams” for unit testing. If you need a “fake” object, just use MEF to import it into your unit tests.

7 When can we use it? It’s baked right into.NET 4.0  When Arena supports.NET 4.0, it can be used anywhere If you’re impatient, you can download the binaries for.NET 3.5 from mef.codeplex.commef.codeplex.com

8 Less talking, more code!


Download ppt "What the heck is MEF? And why should I care? Jason Offutt Software Engineer Central Christian Church"

Similar presentations


Ads by Google