Category Archives: StructureMap

Hail to the king, baby!

Looks like StructureMap 2.5 dropped this weekend.  Which is nice, as we’ve been running off of the trunk for around six months. On a side note, I never really *openly* mocked the release as the Duke Nukem Forever release, just … Continue reading 

| Leave a comment

The Rhino.Mocks’ AssertWasCalled method does work

This behavior is probably clearly specified somewhere, but somehow it has been non-obvious to the four people on our team to the point that we were leaning toward banning its use. I didn’t want to go that far, so figured … Continue reading 

Also posted in Agile | Leave a comment

Integrating StructureMap and NHibernate with WCF

Following many examples I found online for other IoC containers, I borrowed utilized those designs to create a StructureMap instance provider.  One problem we ran into with that design was dealing with NHibernate.  Mainly, there are two types that are … Continue reading 

Also posted in NHibernate, WCF | 16 Comments

Some IoC Container guidelines

So Derick Bailey asked me the other day a few weeks ago to describe how we use our IoC container.  I wouldn’t call it “best practices”, though some of these tips came from the creator of our container of choice, … Continue reading 


Building arrays in StructureMap 2.5

Although it was possible in previous versions of StructureMap, the new fluent interface for StructureMap configuration in version 2.5 allows easy configuration of array type constructor parameters.  For example, consider a simple order processor pipeline: public class OrderPipeline { private … Continue reading 


StuctureMap: Advanced-level Usage Scenarios (Part 1: Type/Convention Scanners)

I’ll start with my strong hand on the advanced StructureMap-foo and go straight to the type scanners (a.k.a. convention scanners).  Thankfully, there was a thread on the StructureMap Users mailing list with just the kind of problem these things solve. … Continue reading 

Also posted in altnetconf | Leave a comment

Integrating StructureMap with WCF

When developing with an IoC container like StructureMap, eventually some place in your code you will need to call the registry to instantiate your classes with their dependencies.  With StructureMap, this means a call to ObjectFactory.GetInstance.  Ideally, we’d like to … Continue reading 

Also posted in Tools, WCF | 39 Comments

StructureMap: Interlude

I’m trying to wrap up the “StructureMap: Advanced Scenarios Usage” post. In the meantime, I wanted to make you aware of a few things: I just updated my StructureMap: Basic Scenario Usage post with a correction. I was mistaken about … Continue reading 

Also posted in ASPdotNET | Leave a comment

StructureMap: Medium-level Usage Scenarios

This is a follow-on to my previous post about basic usage scenarios for StructureMap.  This post will focus on slightly more advanced usage scenarios and how StructureMap handles them.  For those playing the home game, I’m still working on the … Continue reading 

Also posted in Misc | 2 Comments

StructureMap: Basic Scenario Usage

First, I’m going to assume that you are somewhat already familiar with the concepts of Dependency Injection and what, in general, an Inversion of Control Container is for. If not, you may find these links helpful:   I’m … Continue reading 

Also posted in Agile | Leave a comment