Monthly Archives: April 2012


If there’s something you’d like this blog to cover, then add a comment below. Put it in the user story format. As a TYPE OF CONTEXT I want to TYPE OF ACTIVITY to achieve DESIRED OUTCOME. E.g. As a user of the strategy pattern, I

Posted in Uncategorized

Espirit D’Escalier

A quick lesson on why code is never finished until it’s finished. I was just sitting eating lunch and this morning’s code example ran through my mind. Check it out on this link. The crux of it was a generic

Posted in .NET

A Lazy Initializing Strategy Selector in .NET 4

Before I start, I should point out that I would never use the following code in production. I think it’s overkill. In a situation where I wanted to map some real-world key to a strategy, say a database value to

Posted in .NET, Design Patterns

Should Strategy Objects Have State?

The previous post on saving memory with Strategy objects was around using singleton instances of them rather than creating a new one every time. This has advantages: Lower overhead of object creation Maximum of 1 of each of the strategies

Posted in Design Patterns

Saving Memory and the Strategy Pattern

As might be seen from the previous two posts, memory management is a bit of a hot issue at the moment. Before going round clearing up big objects, it may be worthwhile looking at savings that can be made elsewhere.

Posted in .NET, Design Patterns

Get Rid of Disposable and My Object in .NET – the memory lingers on

I have researched the tricky subject of Garbage collection some more. In short, read this article on the fundamentals and you will be wiser. I think the problem with Garbage Collection is that it’s something that’s meant to just work.

Posted in .NET

To Dispose or not To Dispose

Once upon a time there were functional programming languages where you did what you needed to do explicitly within the function: C (slightly fictional) Then object oriented languages came along and the above pattern kind of continued, though someone came

Posted in .NET