Rc2010 mef

308 views
270 views

Published on

RefreshCache 2010 presentation on Microsoft's Managed Extensibility Framework and how to apply it to Arena ChMS.

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
308
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Rc2010 mef

  1. 1. What the heck is MEF?<br />And why should I care?<br />Jason Offutt<br />Software Engineer<br />Central Christian Church<br />Email: jason.offutt@cccev.com<br />Twitter: @JasonOffutt <br />#RefreshCache<br />
  2. 2. Managed Extensibility Framework<br />Originally an Open Source project started by Microsoft developers (mef.codeplex.com)<br />Now comes baked into .NET 4.0<br /><ul><li>Included in System.ComponentModel.Composition</li></li></ul><li>And I should care because?<br />It allows us to make our code more like Legos<br /><ul><li>Modular & pluggable
  3. 3. Encapsulated functionality
  4. 4. Not dependent on other </li></ul> components<br />
  5. 5. So what can MEF do?<br />Act as an IoC container<br />Manage dependency injection without tons of configuration<br />Plays match-maker for your code<br />“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)<br />
  6. 6. How can Arena benefit from MEF?<br />MEF can simplify the way we do dependency injection<br /><ul><li>Less code to maintain!
  7. 7. No need for configuration in web.config or Arena Org Settings and Lookups
  8. 8. MEF will dynamically load the correct object based on the contract/interface declared at runtime
  9. 9. Allows for lazy-loading objects to delay expensive database calls</li></li></ul><li>How can Arena benefit from MEF?<br />Allows us to keep our components very loosely coupled<br />Makes it easier to write testable code<br /><ul><li>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.</li></li></ul><li>When can we use it?<br />It’s baked right into .NET 4.0<br /><ul><li>When Arena supports .NET 4.0, it can be used anywhere</li></ul>If you’re impatient, you can download the binaries for .NET 3.5 from mef.codeplex.com<br />
  10. 10. Less talking, more code!<br />

×