Designs by Duhart All infographics

Infographic 08 · D3 · Aliens block

The seventh limb

A class is state plus the limbs allowed to touch it. Six of them look like ordinary work. The seventh decides what a failure leaves behind, and it is the one that usually never gets designed.

Blueprint, stamp, limbs, acid bloodhover a limb

The error path gets its own beat rather than arriving with the other six, which is the whole point of the sequence. In real code it arrives last too, if it arrives at all.

The limbs

MethodKindWhat it does
rows()queryreads the state, changes nothing
schema()queryreads the state, changes nothing
load()commandthe constructor should have done this
normalise()commandthe actual job
write()commandthe side effect, named as one
close()commandnothing outlives the object
on_failure()errorroll back, mark dead, or rethrow

One blueprint, three species

VariantWhat it handles
Flatone row in, one row out
Nestedwalks a tree, emits leaves
Transposedcolumns are records

The caller asked for a normaliser and never learned which one it got. That ignorance is the feature, and it is what stops the call sites changing when a fourth variant turns up.

Campaign day 79. The written piece is in the writing index.