2

I'm creating a multi layer project with a lot of different assemblies and using dependency injection.

I was thinking about using some tool for composition but not sure which one to use.

MEF and Unity are strong candidates.

I think that MEF could perhaps help if I change the web part to multi tennant type.

So which one in your opinion would be good for composition mainly if I know neither of them and please include argument if able.

Ingó Vals
  • 4,788
  • 14
  • 65
  • 113
  • 3
    There are various questions relating to this all over stack overflow. http://stackoverflow.com/questions/1288376/mef-vs-any-ioc, http://stackoverflow.com/questions/3288558/using-mef-as-an-ioc, etc. – Matthew Abbott Sep 28 '11 at 15:57

1 Answers1

2

It depends. In my opinion, I prefer MEF than Unity as MEF based on declare composition and don't need many configuration. If you don't have the requirements which need to control components strictly such as dependency, you can try MEF.

Simon. Li
  • 404
  • 2
  • 11
  • I used MEF and obviously both these methods lack something the other has. I guess if you are doing a proper project you could use both. I saw some guide on it somewhere. – Ingó Vals Feb 08 '12 at 14:14