5

I am thinking of using MEF to manage the fluent interface on Castle Windsor. Allowing for me to swap out different sections of the system for test and production. Has anyone done this if so how well did it work for you?

Erin
  • 2,368
  • 3
  • 19
  • 23
  • 1
    Why use Castle Windsor if MEF can handle IoC itself? – Phil C Apr 03 '11 at 10:41
  • Because from what I have read MEF is not a true IOC with life cycle support. – Erin Apr 03 '11 at 16:05
  • I guess there is no advance on this then: http://msmvps.com/blogs/peterritchie/archive/2010/02/24/mef-is-not-an-ioc-container-but-mef-uses-ioc.aspx – Phil C Apr 05 '11 at 16:48
  • From my understanding there isn't. MEF gives me the ability to add or change on the fly by refreshing the catalogs. I don't know of an IOC do. – Erin Apr 05 '11 at 19:26

1 Answers1

2

It's true, MEF can be made to act like a DI container but only for simple scenarios. From my experience and based on research I've done MEF's and IoC containers ideal roles might be:

  • define third-party extension points using MEF
  • locate and load these extensions using MEF
  • structure and manage the host application’s fixed architecture using an IoC container