Chapter 11. StructureMap



  • Introducing StructureMap
  • Managing lifetime
  • Working with multiple components
  • Configuring difficult APIs

In the previous chapter, we looked at the Castle Windsor DI CONTAINER to see how the principles and patterns described in parts 13 can be applied. In this chapter, we’ll do exactly the same with another DI CONTAINER: StructureMap.

StructureMap is the oldest DI CONTAINER for .NET—it has been around longer than the others. Despite its age, it’s still being actively developed and has many modern features, so we should view its age mostly as a testament to its maturity. It’s also one of the most commonly used DI CONTAINERS.[1]

1 Once more I need to stress that there are no scientifically sound statistics about DI CONTAINER usage, so all such claims are based on ad hoc internet polls, and so on. Take it for what it is.

In this chapter, we’ll examine how StructureMap can be used to apply the principles and patterns laid forth in parts 13. Figure 11.1 shows the structure of the chapter.

11.1. Introducing StructureMap

11.2. Managing lifetime

11.3. Working with multiple components

11.4. Configuring difficult APIs

11.5. Summary