Contents tagged with ioc

  • A Gentle Introduction to StructureMap

    I found myself explaining inversion of control containers and their benefits to someone today, and so I created a very simple console application that makes use of StructureMap (my favorite such container).  You can view the whole file in this Gist.  Here I’ll just briefly explain what’s going on. The main benefit of a tool like StructureMap is to decouple your classes from their collaborators.  Rather than classes knowing exactly which implementations they’re working with, they publish their needs for collaborators in their constructors, providing explicit dependencies (see my other posts on dependencies).  The IoC container then is used to provide these classes with the … more