Difference between MEF and IoC containers (like Unity, Autofac, SMap, Ninject, Windsor.Spring.net, etc.)

Eventually what I have concluded about the MEF vs IoC container is as follows: MEF is preferred to be used when one has to deal with unknown types or a plugin based architecture. IoC containers are preferred to be used with known types. Moreover, MEF is an architectural solution for dependency injection Whereas, IoC containers … Read more

Passing constructor arguments when using StructureMap

I suggest declaring that with the StructureMap configuration. Using the slightly newer StructureMap code: For<IProductProvider>().Use<ProductProvider> .Ctor<string>(“connectionString”).Is(someValueAtRunTime); This way you don’t burden your client code from having to know the value and can keep your IoC configuration separate from your main code.

Comparing Castle Windsor, Unity and StructureMap

See here and here for a pretty thorough technical comparison of several IoC containers, although somewhat outdated by now (they’re from before Windsor 2.0) However, I don’t think there are really any vital features that Windsor offers and other containers don’t. Windsor, StructureMap, Spring.NET have all been around for several years and have been used … Read more