← The field guide

SPECIMEN No. 036 Β· Architectural reflex

Premature Abstraction

Making something generic before the second use case exists, so that the third one can arrive and not fit.

🌱 Perennial
🏠 Habitat
Codebases with exactly one payment provider
🦈 Natural predator
The third provider
πŸ€’ Common symptom
ProviderAgnosticCapabilityLayerFactory

βœ… GOOD FIT

  • Two concrete providers already exist, with a third signed
  • Vendor boundaries where switching cost is a real risk
  • Public interfaces that will be painful to change later

🚩 TOO FAR

  • ProviderAgnosticCapabilityLayerFactory with exactly one provider
  • The third provider arrives and fits nothing
  • A diagram of the abstraction, and no working code yet

🎯 SWEET SPOT

Super Reasonable

Write the second integration plainly next to the first, then extract the shared shape from working code. Put a thin adapter at vendor boundaries early, since that one is cheap, and wait for the third case before anything grander.

IN THE WILD Β· 1 STORY Β· 1 TAKE

Observed Premature Abstraction