1 / 8

What the heck is MEF?

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. Managed Extensibility Framework.

peony
Download Presentation

What the heck is MEF?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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) • 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.com

  8. Less talking, more code!

More Related