I don't know about the implications of MEF, but I can say that MEF is a framework that addresses extensibility issues for applications. The focus is on enabling add-in scripts for standard software. It shares so many features with the “right IoC containers” that in the future it could become a full-fledged IoC container.
Mef was built for another purpose, and then for the IoC container. Its purpose is to provide a general framework for enabling add-on features for standard applications. From the perspective of a standard application, the add-in is essentially an unknown component .
When we use the IoC container as a tool for compiling the application, we know about the components that make up the application.
IoC containers are aimed at an untied set of services, which is good, but the developer must know about the components that he wants to compose at the time of configuring the container, when the MEF is aimed at detecting components. The only thing you should know is the abstraction that you want to use.
MEF shares so much in common with IoC containers that it’s sometimes difficult to say how we should take this into account.
I think the main disaventage of MEF:
- poor lifecycle management compared to IoC
- lack of interception
What are the main points when discussing IoC containers.
source share