The Rotten Domain Model is dead; long live the Abstracted Domain Model

abstractMany years ago, back when OO was a new, exciting idea that appeared to offer a panacea solution to developing applications, Martin Fowler wrote an article entitled “Anemic Domain Model” (ADM), in which he argued that separating data from functionality, within the OO paradigm, is an anti pattern.

Twelve years later, things have moved on quite a bit. Many now recognise the benefits of such a split; yet some still, near-religiously, stick to the idea that the anaemic data model is somehow “not real OO”. Part of this stems from the (presumably deliberate) use of a negative term to describe that separation approach. It’s therefore time to fight back with new definition of the terms “RDM” and “ADM”, to help move us away from the antiquated view that separating data from functionality is an anti-pattern. It’s the RDM that has been shown to be the real bad design approach.
Continue reading “The Rotten Domain Model is dead; long live the Abstracted Domain Model”

The slow death of agile

skullRecently, I heard of a job interview in which the applicant claimed on their CV that they worked for a “strict agile” company. At the time, I thought of this as a good thing. However, reflecting upon it, it strikes me as yet another example of a worrying trend around agile practices, namely treating only specific ways of working as being agile. “Strict agile” is really an oxymoron: it’s another sign that we are witnessing the death of agile through “processification”, or the setting in stone as to what “agile” can be. Continue reading “The slow death of agile”

Inheritance: just stop using it already!

no_inheritanceThere are certain constructs in programming languages that demonstrably lead to bad code in the vast majority of use-cases. There is a term for these constructs: anti patterns. An anti-pattern is a way of solving a problem that often appears quick and simple, but that leads to more work and more problems in the long run. Think of nailing two pieces of wood together, rather than drilling a guide hole and using a screw. The former is quicker, but the repair when the wood splits can be both costly and time consuming. Programming languages can enable, and sometimes even encourage, such anti-patterns. Whilst goto might be the best known, there are three other contenders for the worst anti-pattern of all: not writing automated tests, null and object-orientated (OO) inheritance. It’s the last that is the topic of this post. Continue reading “Inheritance: just stop using it already!”