tags:

views:

50

answers:

2

I'm starting a new personal Prism 4 project. The Reference Implementation currently uses Unity.

I'd like to know if I should use MEF instead, or just keep to Unity.

I know a few discussions have mentioned that these two are different, and they do overlap, but will I be missing out if I simply choose Unity all the way?

+3  A: 

Hi,

This thread provides some useful insight on this subject.

Damian Schenkelman
Thanks! This is what I was looking for!
Jason Banico
+1  A: 

I am currently doing the same investigation. I was last week attending the p&p symposium at Redmond. I had the chance to chat with some of the p&p people on that.

MEF

+Part of .net, no need for extra libraries

+Very powerful in extensibility, modularity scenarios

-More generic approach, less flexible for DI scenarios

-You need to decorate with attributes, your code is glued to MEF

Unity

+Very flexible for DI scenarios

+If you stick with ctor injection and avoid using named instances then you don't need to use any attributes. Most of your system doesn't rely on Unity

-No out of the box support for extensibility, modularity scenarios

-Need to deploy the 3rdparty libraries

What I think is a good idea is to use MEF for extensibility (manage the modules of your app, localize registrations) and use Unity for DI.

bakopanos costas
That's what I figured. For Prism, I'll use MEF for modularity, and Unity for code plumbing (dependencies, AOP, etc)
Jason Banico

related questions