Rc2010 mef
-
Upload
jasonoffutt -
Category
Technology
-
view
238 -
download
4
description
Transcript of Rc2010 mef
![Page 1: Rc2010 mef](https://reader036.fdocuments.us/reader036/viewer/2022082702/55496cc3b4c905525e8b4d69/html5/thumbnails/1.jpg)
What the heck is MEF?
And why should I care?Jason Offutt
Software EngineerCentral Christian Church
Email: [email protected]: @JasonOffutt
#RefreshCache
![Page 2: Rc2010 mef](https://reader036.fdocuments.us/reader036/viewer/2022082702/55496cc3b4c905525e8b4d69/html5/thumbnails/2.jpg)
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
![Page 3: Rc2010 mef](https://reader036.fdocuments.us/reader036/viewer/2022082702/55496cc3b4c905525e8b4d69/html5/thumbnails/3.jpg)
And I should care because?
• It allows us to make our code more like Legos Modular & pluggable Encapsulated functionality Not dependent on other
components
![Page 4: Rc2010 mef](https://reader036.fdocuments.us/reader036/viewer/2022082702/55496cc3b4c905525e8b4d69/html5/thumbnails/4.jpg)
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)
![Page 5: Rc2010 mef](https://reader036.fdocuments.us/reader036/viewer/2022082702/55496cc3b4c905525e8b4d69/html5/thumbnails/5.jpg)
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
![Page 6: Rc2010 mef](https://reader036.fdocuments.us/reader036/viewer/2022082702/55496cc3b4c905525e8b4d69/html5/thumbnails/6.jpg)
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.
![Page 7: Rc2010 mef](https://reader036.fdocuments.us/reader036/viewer/2022082702/55496cc3b4c905525e8b4d69/html5/thumbnails/7.jpg)
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
![Page 8: Rc2010 mef](https://reader036.fdocuments.us/reader036/viewer/2022082702/55496cc3b4c905525e8b4d69/html5/thumbnails/8.jpg)
Less talking, more code!