The dreaded “Save(Foo bar)”

For the last year or so my biggest antagonist has been “Save(Foo bar)”. There is usually a lot of things going wrong when that method turns up. I’m not saying that saving stuff to the persistence storage is a bad Continue reading

Posted in Architecture, design patterns | Tagged Architecture, design patterns | Leave a reply

NDC2010: Michael Feathers – The deep synergy between good design and testability

In this session Michael Feathers basically killed the argument based on; I don’t want tests to drive my design with a simple example base on the code smell; Iceberg class. Private methods are really hard to test, and here we Continue reading

Posted in NDC2010 | Tagged design patterns, NDC2010, TDD | 2 Replies

NDC2010: Michael Feathers – Testable C#

This session was basically explaining a simple rule that regardless if you are using TDD; should be followed at all times: Never hide a TUF in a TUC What did Michael mean by that? There are two things that can Continue reading

Posted in NDC2010 | Tagged design patterns, NDC2010, TDD | 1 Reply

Pattern focus: Decorator pattern

The decorator pattern is a pretty straightforward pattern that utilizes wrapping to extend existing classes with new functionality. It’s commonly used to apply cross-cutting concerns on top of business classes, which avoids mixing that up with the business logic. Frameworks Continue reading

Posted in Code Design, design patterns | Tagged Decorator pattern, design patterns, Refactoring | 3 Replies

Tracking a property value changes over time: Temporal property using NHibernate

A common problem that often needs to be solved is to answer a question like “how did my inventory look 1 month ago?”. Keeping this kind of history, and query over it, can be tedious and is something that need Continue reading

Posted in design patterns, ORM | Tagged design patterns, NHibernate | 7 Replies

Creating a dynamic state machine with C# and NHibernate

In my last post (An architecture dilemma: Workflow Foundation or a hand rolled state machine?) I talked about the discussion around an architectural choice. The conclusion of that discussion was to hand-roll a dynamic state machine. This post is the Continue reading

Posted in Architecture, Code Design | Tagged design patterns, many-to-many, NHibernate, State Machine | 5 Replies