June 2010 Blog Posts

StructureMap: Part 3 – Constructing the Concrete Type

Index Part 0 – Introduction Part 1 – The Basics Part 2 – Instance Lifecycles Part 3 – Constructing the Concrete Type Part 4 - Scanning Now that we can control the lifecycle of an instance it’s worth considering how those instances are constructed. In the code shown so far the parameter-less Use method is responsible for specifying the concrete...

posted @ Friday, June 18, 2010 12:53 AM | Feedback (0)

StructureMap: Part 2 – Instance Lifecycles

Index Part 0 – Introduction Part 1 – The Basics Part 2 – Instance Lifecycles Part 3 – Constructing the Concrete Type Part 4 - Scanning  So far I’ve shown how to do basic registration. This will let the container know of the type so that it will try to create it. This registration gives us the defaults that StructureMap...

posted @ Sunday, June 13, 2010 1:22 PM | Feedback (0)

StructureMap: Part 1 – The Basics

Index Part 0 – Introduction Part 1 – The Basics Part 2 – Instance Lifecycles Part 3 – Constructing the Concrete Type Part 4 - Scanning Let’s start at the beginning which is allegedly a very good place to start. Before StructureMap can construct any kind of concrete type for you it must be told what it should construct. StructureMap...

posted @ Saturday, June 12, 2010 11:26 PM | Feedback (1)

StructureMap: Part 0 - Introduction

Dependency Injection is a shamefully under-utilised practice in .NET development. There’s really little excuse for this as there are a number of serviceable frameworks available. These include Castle Windsor (http://www.castleproject.org/container/index.html), Spring.NET (http://www.springframework.net/) or even Unity (http://unity.codeplex.com/) if you’re stuck at a Microsoft-only shop. However my personal preference is StructureMap (http://structuremap.github.com/structuremap/) which has a number of features that I like: Simple deployment There’s a single StructureMap assembly to be referenced and it’s rare to encounter a situation where you need multiple incompatible versions. Minimally intrusive StructureMap doesn’t require the use of attributes, marker...

posted @ Saturday, June 12, 2010 11:25 PM | Feedback (2)