13. February 2010 21:15
As said in an earlier post I wanted to clarify, at least for myself, the difference between Unity, MEF and PRISM. This post will shortly try to do just that by listing some of the main points and advantages of each technology.
Unity vs MEF
Unity is mostly used for static dependencies and is more an “internal” technology, meaning outsiders do not need to know that unity is being used in the application.
MEF should be used for dynamic dependencies, it is grate at dynamically loading components and with the use of attributes it make creating application extensions or an application that can be extended by others easy and streamlined.
MEF vs PRISM
I would say the main difference between PRISM and MEF is that PRISM is targeted for UI module based application and MEF is more for components with focus on extensibility.
PRISM has RegionManager, EventAggregator and Commands all with the purpose of solving decoupling issues related to UI components, whereas MEF only focuses on dynamically loading components.
With that said, it seems the PRISM team will use a mixture of MEF and Unity in the next release. Drops of PRISM 4, should be just around the corner!
- MEF is not an IoC container, even though it uses IoC concepts.
- Unity is an IoC container, which is its main purpose.
- MEF focuses on application extensibility with component discovery and composition.
- PRISM is “a complete solution” for developing UI applications.
- MEF is not “a complete solution” for developing UI applications although it can be used for creating applications that can be extended.