Conformista

Escrito por Darjus Kazakevic · revisado el

Use their model as it is, and spend the saved effort elsewhere.

Upstream is the context that provides data; downstream is the one that uses it. In a conformist relationship, the downstream team uses the upstream model directly: its types, its names, its codes. In an online shop, Support might use Salesforce's Contact type everywhere, with no Contact class of its own.

That sounds like giving up, but often it is the right call. When the upstream model is clean, you cannot change it, and the area is not where you compete, a translation layer costs effort and returns little. The price is that every upstream change becomes your change.

En esencia — Adopt the upstream model exactly as it is, with no translation layer, giving up your own model in return for almost no integration work.

Cuándo recurrir a él

Recurre a él cuando

  • A generic area you were never going to model richly
  • The upstream model is clean and you cannot change it
  • A translation layer would cost more than the upstream changes do

Reconsidéralo cuando

  • The upstream data drives your core rules, like pricing
  • The upstream model is confused and would confuse yours
  • You have influence upstream: customer–supplier is better

Conceptos clave

No translation
Downstream code uses upstream types and names directly. There is no port, no mapper and no model of your own for this data.
No vote
Downstream cannot change the upstream model or get its needs into upstream's plan. That lack of influence is usually why teams conform.
A recorded decision
A note in the code that says why you conform and what would make you stop. A deliberate conformist and an accident look the same in the code six months later.

Reglas de diseño

Conform only where you do not compete
Skip the translation layer in generic areas with a clean upstream model, like CRM sync. Add an anti-corruption layer the day that data starts to drive pricing or other core rules.
Write down that you chose it
Record why you conform and the condition for changing. Without that note, the next engineer cannot tell a choice from an accident.
Copy only a clean model
If the upstream model is confused (unclear states, fields with two meanings), its confusion becomes yours. Conform to clean models; translate messy ones.

Errores habituales

  • Conforming by accident and never writing the decision down
  • Conforming in the core subdomain, where your own model matters most
  • Upstream types spreading so far that adding an ACL becomes a rewrite