Tell, don’t ask
Tell, don’t ask is a way of thinking when you’re programming software, a mindset. It is something that should be in the back of your head every time you write a line of code, or a chunk of code that describes some functionality. It is not something you merely apply when trying to solve a [...]
Glue – the new mapping framework
I’ve spent this summer implementing a new mapping framework for the .Net plattform: Glue.
You’ll find examples and code here: http://glue.codeplex.com
Glue is a general purpose, bidirectional automatic mapping for the .Net platform, with strong verification and testing tools.
I’ve seen quite a lot of less than optimal handling of mapping issues in quite a few projects over [...]
ASP.NET MVC: DefaultControllerFactory is not thread safe!
I am not sure if this is a bug or a “feature” of the ASP.NET MVC framework. Either way, this is something you should be aware of as it can cause some very hard to track concurrency issues which might leak information between your HttpRequests.
In my last project we used the ASP.NET MVC framework along [...]
ASP.NET MVC: Let StructureMap create your controllers
For those of you already familiar with StructureMap and want to use it to configure your objects in ASP.NET MVC, read on.
The ASP.NET MVC framework has a default controller factory (DefaultControllerFactory) that requires all controllers to have a parameterless constructor. So, if you want to inject your dependencies to the constructor, you can’t do it. [...]
Understand, don’t just follow
It still surprises me, and scares me, how many people in our industry that just follow ideas and practices just because “someone” says it is the way to go, and how those same people do not understand why they are actually doing it.
Let me give you an example.
When Kent Beck and his extreme programmers started [...]
Recommended Books
I just added a new page on my blog: Recommended Books. I will update it regurarly. You can also subscribe to the recommendations (feed at the bottom of that page).
Unit tests should not test software
Register your claim
When I refactor or make changes to code I need somehow to verify that the changes do not break anything. I want to do it with unit tests. Unit tests are my safety net. My philosophy on unit testing is something like, if you do not want me to change some of your [...]
The importance of code that communicates
One of the major reasons that our industry produces software that is full of bugs, with a massive cost of change and with a short life expectancy is that developers do not understand the importance of writing code that communicates. Yes, one of the most important aspects of software development is to write code that [...]
Interviewing Clemens Vasters
In december Lars Wilhelmsen and I made an interview with Clemens Vasters. We talk about different topics around the new Azure and Cloud technologies from Microsoft. Clemens Vasters works as a Program Manager in the .NET Online Services team and is responsible for the ‘Service Bus’ feature area of Microsoft’s upcoming Cloud Platform.
Børge Hansen from [...]
Refactoring
To make it clear: “Refactoring” (as the term made famous by Martin Fowler in his great book with the same name), means to change the code without changing its behavior. Too many people talk about refactoring when changing some of the behavior of a system. This interpretation is just plain wrong.
This distinction is not just [...]

