Shared because they looked alike
No wall · blast cascadesBecause the database table is shared as the API DTO, renaming one internal column cascades through every client and sibling domain.
Governing Principle · IEP
Things that can evolve independently should be owned, represented, and contracted independently. Things that change together live together.
Two shapes looking identical today does not mean they share an owner, a lifecycle, or a reason to change. Similarity is not ownership. Align the shape of your dependency graph with the shape of change so every edit stops as close as possible to the place that owns it.
Interactive flow proof
A boundary earns its existence by absorbing change. Pick a realistic edit below and trace the arrows: in a coupled codebase, one change ripples through every consumer; under Independent Evolution, the boundary wall stops it cold.
Because the database table is shared as the API DTO, renaming one internal column cascades through every client and sibling domain.
The persistence boundary absorbs the rename inside billing/store.ts. The hand-written wire contract never moves, so clients and shipping stay untouched.
Mildly petty, technically true
Most frameworks optimize for the 5-minute demo by collapsing independent owners into a single shortcut. It feels fast on day one — then turns every schema change, second client, or vendor swap into a repo-wide tax. Pick a stack to see the trap:
// app/invoices/page.tsx (Server Component)
import { db } from "@/lib/db";
import { InvoiceCard } from "./invoice-card";
export default async function Page() {
// DB row handed straight to UI props — zero wire contract
const rows = await db.select().from(invoicesTable);
return <InvoiceCard invoices={rows} />;
}
// app/invoices/actions.ts ("use server")
export async function renameInvoice(id: string, title: string) {
// Tied to Next's RPC transport; unreachable from mobile or webhooks
}
Server Components and 'use server' actions erase the wire boundary completely. Your SQL columns become React props, and mutations live behind a Next-only RPC protocol. The day you add an iOS app, public API, or partner webhook, you have to build a real backend boundary from scratch.
// domains/billing/contract/wire.ts (owned wire boundary)
export const invoiceResponse = z.strictObject({
id: invoiceId,
amountMinor: z.number().int(),
});
// apps/web uses typed callApi() — same contract as iOS & webhooks.
// apps/customer exposes OpenAPI 3.1 + compile-time access checks.
Web is just one client of an explicit Zod wire contract. Your React UI, mobile app, and external integrations share the exact same typed contract without leaking a single Postgres column.
| Framework / Pattern | Shortcut it pushes | Boundary broken | Day-2 tax |
|---|---|---|---|
| Next.js | Server Components passing DB rows as props + "use server" RPC |
Wire ↔ Clients · Persistence ↔ Wire | No real HTTP contract when mobile, webhooks, or a second API arrives. |
| NestJS | Decorated Entity/DTO classes + global DI / forwardRef() |
Domain ↔ Domain · Persistence ↔ Wire | One class owns SQL + OpenAPI + DTO; DI hides cross-domain coupling until boot. |
| Laravel / Rails | ActiveRecord god-models ($hidden, scopes, lazy views) |
Persistence ↔ Domain ↔ Wire ↔ UI | Table changes leak into controllers, JSON responses, and templates everywhere. |
| tRPC | Sharing server typeof appRouter with inferred ORM returns |
Wire ↔ Independently Deployed Clients | Internal refactors break clients in lockstep; non-TS clients get no contract. |
| ORM-derived DTOs | createSelectSchema(table) / raw Prisma payload types |
Similarity ≠ Ownership | Every new DB column risks leaking on the wire; renames break older clients. |
Both halves of the rule
IEP cuts in both directions. Putting a boundary between independent owners prevents cascading rewrites. Removing unearned layers inside a single owner prevents enterprise ceremony. Every seam must name the real change it absorbs — if you cannot name one, delete it.
Different owners or deploy lifecycles. Explicit contract required.
assembly/) or domain event —
never an internal import.
Authorization, clock, queue, object storage, email,
identity).
One owner, always changes together. No port, no extra file, no fake layer.
FooServiceInterface + FooServiceImpl when only one
implementation exists.
// Renaming a column breaks mobile & web clients
export const invoiceDto = createSelectSchema(invoicesTable);
// Also silently exposes internal columns like
// internal_cost_cents or stripe_customer_id.
One schema serves two owners (Postgres storage and external HTTP clients) with different lifecycles.
// domains/billing/contract/wire.ts (wire owner)
export const invoiceResponse = z.strictObject({
id: invoiceId,
amountMinor: z.number().int(),
currency: z.string(),
});
Postgres columns can be renamed, split, or indexed inside billing/server/ while the
wire stays frozen.
// domains/shipping/server/routes.ts
import { invoicesTable } from "../../billing/server/tables.js";
// Every Billing migration now dirties Shipping's tests.
Shipping depends on how Billing happens to store rows today rather than the fact it actually needs.
// domains/shipping/server/ports.ts
export type OrderPaymentStatus = {
isPaid(orderId: OrderId): Promise<boolean>;
};
// Wired once in assembly/services.ts — enforced by dad check boundaries.
Shipping depends only on isPaid(orderId). Billing can replace its entire storage engine
underneath.
NoteValidatorInterface.ts
NoteValidatorImpl.ts
NoteMapperFactory.ts
NoteControllerAdapter.ts
// No second implementation exists. Changes hit all 4 files.
Abstracting inside one owner creates ceremony without absorbing any real independent change.
// domains/notes/pure/note-rules.ts
export function normalizeTitle(raw: string): string {
return raw.trim().replace(/\s+/g, " ");
}
// Direct import, concrete types, zero ceremony.
IEP outranks structural habits whenever a habit demands a seam that cannot name a real change it absorbs.
Design & PR checklist
Run these seven questions during code review or architecture design. They replace taste arguments with one consistent rule.
Name the exact changes that must stop at this boundary. If nothing stops, the boundary is decorative.
Dependencies point toward whoever owns the meaning, not toward whichever file happened to exist first.
Could both sides reasonably change at different times for different reasons? If yes, separate them.
Is the consumer relying on what the provider means to expose, or on how it happens to be implemented?
Name a real second client, vendor swap, or domain release. If you cannot name one, delete the layer.
If this file changes, what else re-runs in CI? Run dad-test diagnose to measure the real
blast radius.
Are we sharing a type because both concepts truly evolve together, or merely because they look alike today?
The payoff
An architectural principle is unfinished until ordinary tools enforce it. Every major tool in Dads is a direct consequence of the Independent Evolution Principle.
dad check boundaries and dad doctor --gate stop cross-domain imports, vendor
leaks, and unsafe shortcuts before code review — whether a human or an AI agent wrote the PR.
Every permission check runs behind one app-owned Authorization capability proved in 27 Lean
4 theorems — swap PostgreSQL, SQLite, or SpiceDB at one seam without touching a single route.
When your dependency graph matches real ownership, dad-test mathematically proves which
tests a diff can reach (36 Lean 4 theorems) — and dad-test diagnose exposes every leak.