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

When would you use the Common Service Locator?

Imagine you are writing library code to be used by 3rd party developers. Your code needs to be able to create service objects that these developers provide. However you don’t know which IoC container each of your callers will be using. The Common Service Locator lets you cope with the above without forcing a given …

Read more

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

What is a DI Container?

According to Dependency Injection Principles, Practices and Patterns, a DI Container is: “a software library that provides DI functionality and allows automating many of the tasks involved in Object Composition, Interception, and Lifetime Management. DI Containers are also known as Inversion of Control (IoC) Containers.” (§3.2.2) At the very least, a DI Container allows Auto-Wiring, …

Read more

Where exactly is the difference between IoC and DI [duplicate]

In common usage, the terms have become somewhat synonymous. The original idea of IoC — Inversion of Control — was very much related to the “Hollywood Principle:” Don’t Call Us, We’ll Call You. In traditional applications, developers would write business code and framework code. The business code would then call the framework code to accomplish …

Read more