Are primitive constructor parameters a bad idea when using an IoC Container? [closed]

Well I ended up redesigning this after reading the book Dependency Injection in .Net (I highly recommend this book to any object-oriented developer, not just .Net developers and not just those interested in using an IoC container!). I’ve now got the following in a Domain assembly: public interface IImageFileService { void RenameFiles(); void CopyFiles(); } … Read more

How to remove(unregister) registered instance from Unity mapping?

I had the same problem and just removed the registrations of the ContainerControlledLifetimeManager from my Container: foreach (var registration in container.Registrations .Where(p => p.RegisteredType == typeof(object) && p.Name == name && p.LifetimeManager.Type == typeof(ContainerControlledLifetimeManager))) { registration.LifetimeManager.RemoveValue(); }

Which Dependency Injection Tool Should I Use? [closed]

Having recently spiked the use of 6 of these (Windsor, Unity, Spring.Net, Autofac, Ninject, StructureMap) I can offer a quick summary of each, our selection criteria and our final choice. Note: we did not look at PicoContainer.Net as one of our team considered the .Net port to be quite poor from the Java version. We … Read more

Why are IOC containers unnecessary with dynamic languages

IoC provides a mechanism to break the coupling you get when an object calls ‘new’ on another class. This coupling ties the calling object with the instantiated implementation of whatever interface it implements. In static languages when you reference a class by name (to call new on it), there is no ambiguity. This is a … Read more

IoC.Resolve vs Constructor Injection

IoC.Resolve<> is an example of the Service Locator pattern. That pattern imposes a few restrictions that constructor injection does not: Objects can have no more fine-grained context than the application domain, due to the static calls Objects decide which versions of dependencies to resolve. All instances of a certain class will get the same dependency … Read more