There is some obvious overlap but also a clear delineation. In particular when it comes to UI composition. MEF can be used for UI composition for sure, however it doesn’t have specific UI composition bits like RegionManager, Composite Commands, EventAggregator.
In general though here are the differences.
- First, MEF is in the platform as part of SL4/FX4.
- Second, MEF is a general UI agnostic composition technology while Prism is specific for UI composition. MEF also extends beyond composite applications to general extensibility / plugin models.
- Third, Prism and MEF can work together.
There are two primary use cases i hear about for MEF and Prism working together.
- Use Prism with MEF as an add-on for extensibility. That is make modules extensible through MEF. You can think of this as the “Two worlds in harmony” solution. Your core architecture rests on Prism’s modularity / and an IoC Container and sits side by side with MEF.
- Use MEF primarily for modularity, and pull in Prism bits for UI composition. In this model, your core architecutre sits on top of MEF, with MEF replacing the services of your IoC.