StructureMap

IoC Battle–Revisited

Introduction I have been evangelizing the use of IoC for a number of years. Frequently the newly converted ask the following two questions: Which container to use? Which is fastest? My answer to the first is almost always the one you choose, and for the second question I refer them to Martin From’s IoCBattleweb page. I wont get into the reason for my answer to the first question in this post (I will save that for another day).

IoC Challenge – Multiple interfaces to the same singleton instance

I have an IoC challenge that I am currently trying to work through. I have a series of classes that implement more than one interface, with the lifetime of the class needing to be a singleton, and I really don’t like the idea of falling back on custom instantiation code along with potentially custom lifetime management code to make this work. Sound confusing? Here is the model I am trying for.