Infographic 08 · D3 · Aliens block
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.
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.
| Method | Kind | What it does |
|---|---|---|
rows() | query | reads the state, changes nothing |
schema() | query | reads the state, changes nothing |
load() | command | the constructor should have done this |
normalise() | command | the actual job |
write() | command | the side effect, named as one |
close() | command | nothing outlives the object |
on_failure() | error | roll back, mark dead, or rethrow |
| Variant | What it handles |
|---|---|
| Flat | one row in, one row out |
| Nested | walks a tree, emits leaves |
| Transposed | columns 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.