Archive For The “Refactoring” Category

The trouble with soft delete

Soft delete is a commonly-used pattern amongst database-driven business applications. In my experience, however, it usually ends up causing more harm than good. Here’s a few reasons why it can fail in bigger applications, and some less-painful alternatives to consider. Tomato, Tomato I’ve seen a few different implementations of this pattern in action. First is […]

Read more »

Unit tests for private methods are a code smell

This week I attended a talk where some people were discussing techniques for unit testing private methods — they were going on about problems they had getting something called Private Accessors to work with ReSharper. The tools they mentioned were completely foreign to me, and I wondered why I’d never heard of them. I think […]

Read more »

Domain model refactoring: replace query with composition

Here’s a snippet of ubiquitous language (altered slightly to protect the innocent) from a system I’ve been working on over the past few months: An Officer is a role played by certain Employees. Each Officer is required to be proficient in a number of Competencies, according to [among other things] what District they’re stationed in. […]

Read more »

Domain-Driven Design and OOP: friction = traction

A few days ago I read a really great post by Seth Godwin about Traction and Friction. He’s not a programmer (as far as I know), but writes a lot of insightful articles about strategy and value that can be applied to everyday subjects. This particular article struck a chord in me as a good […]

Read more »

Life inside an Aggregate Root, part 2

This is the second half of a two-part article. Read the first half here: Life inside an Aggregate Root, part 1. In part one I talked about how entities have reference their parent aggregate root. Today I will talk about how new entities are added to the aggregate. Let’s have a look at the spec […]

Read more »