Chapter 15. MEF

 

Menu

  • Introducing MEF
  • Managing lifetime
  • Working with multiple components
  • Configuring difficult APIs

In the previous five chapters, you saw how various DI CONTAINERS can be used as tools to implement the patterns and practices laid out in the rest of the book. In this chapter, we’re going to do something slightly different, because the Managed Extensibility Framework (MEF) isn’t really a DI CONTAINER.

As its name implies, MEF is a framework that addresses extensibility concerns for applications. The focus is on enabling add-in scenarios for standard software. Visual Studio 2010 is probably the first and most prominent application that uses MEF to support plug-ins, but any application built on .NET 4 or Silverlight 4 can use it to expose extensibility features.

If MEF isn’t a DI CONTAINER, then why use an entire chapter covering it in this book? The most important reason is that MEF looks so much like a DI CONTAINER that you need to spend some time with it to understand the differences between it and real DI CONTAINERS. Because it’s part of .NET 4 and Silverlight 4, it may be tempting to use it as a DI CONTAINER if you don’t understand the subtle differences. The purpose of this chapter is to exhibit these differences so you can make an informed decision.

Note

Please keep in mind that you can always skip this chapter if MEF doesn’t interest you and you’ve already decided to use another DI CONTAINER.

15.1. Introducing MEF

 
 

15.2. Managing lifetime

 
 
 
 

15.3. Working with multiple components

 
 

15.4. Composing difficult APIs

 
 
 

15.5. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest