tags:

views:

694

answers:

2

Hey girls and guys!

I am currently working on a WPF project using Prism (CAL) and am wondering if it is a good idea to use both Prism and MEF in one project.

I would use Prism for modularity and MEF for extensibility. My project is a paint-like application so Prism would provide the module-separation (toolbox, canvas as modules etc.) and MEF would be used to provide an extensibility point for new shapes to paint (ie. rectangle, circle..).

Would that make sense or can I get similar functionality with Prism only?

Thanks in advance and best regards, crischu

+2  A: 

Sure! That's a very appropriate thing to do.

MEF looks like it's heading for the .NET Framework so I'd say this was a really good way to expose a plugin surface area that requires a very small (and relatively unchanging) dependency (just on MEF... not all of the other stuff that comes along with Prism) for your plugin authors.

Since it's going to be in the Framework I'd wager more people will become familiar with it than they would Prism.

Anderson Imes
+2  A: 

It is reasonable to do, and we have several customers doing it. MEF is part of the .NET Framework 4.0, as well as the next version of Silverlight. We currently ship MEF for .NET 3.5 on Codeplex.

As far as Prism with MEF, the challenge at this point is you need to write a bunch of code as Prism does not yet have implementations of the services necessary to talk to MEF

One option is to use the MEF/Unity integration layer we have in MEF Contrib (mefcontrib.codeplex.com). It enables Unity and MEF to talk back to one another, thus you can using the existing Prism source with MEF through the Unity bridge.

We are working with p&p to have direct supprot for MEF backed in.

Thanks Glenn

Glenn Block
Exciting stuff. Thanks Glenn.
Anderson Imes