1
pimps
99 days, 21 hours, 22 minutes ago
Sunday, November 01, 2009 8:08:21 PM GMT Sunday, November 01, 2009 1:15:08 PM GMT

Should I use MEF with an IoC container? - Part 1

Should I use MEF with an IoC container? - Part 1
 
codebetter.com -- In my post "Should I use MEF for my IoC needs" we took a look at the question of whether or not it is appropriate to use MEF instead of a traditional IoC container. In this post we'll discuss the question of whether or not you should use both an IoC container and MEF in the same application. MEF and IoC container concerns As we've mentioned in the past, MEF's primary design in V1 is around open-systems whose components (parts) are dynamically discovered at runtime. IoC containers on the other hand are primarily designed for decoupling a closed (fixed) set of application components in order to improve the maintainability of the system by the engineering team. In other words each is addressing a specific set of concerns. So if that is the case then is it plausable to use both in an application? The answer is Yes. Not only that, but we specifically designed MEF with the idea of integration with other containers in mind. Below will explore one of the key-scenarios for doing this. Enabling third-party extensibility in an IoC container-dependent application.  You have an existing customer management system that uses an IoC container such as Castle Windsor which you use in order to promote separation-of-concens and testability. The application leverages advanced Windsor facilities for integrating with NHibernate and for applying cross-cutting-concerns (AOP) such as logging, etc. The loosely coupled design of the system has proven to be greatly beneficial and has minimized the friction for developing and deploying the system through several releases. At some point requests start pouring in from customers want to create their own extensions in order to customize the application in their specific environments. Additionally several ISVs express interest in providing third-party value-adds such as telephony integration, and scheduling.  You determine that adding a third-party extensibility model to the application makes sense in order to address this opportunity. Through your research you come across MEF and realize that i
beebee posted 100 days, 4 hours, 16 minutes ago     show counter code
tags: IOC, MEF

No comments yet, be the first one to post comment.

To post your comment please login or signup