Understanding how frontend systems evolve under pressure.
Most frontend systems do not begin with architecture. They begin with delivery.
Systems rarely fail because of patterns.
They fail because prior decisions stop holding under new pressure.
Centralization solved divergence.
But business rules are changing weekly.
Tax laws differ by region. Shipping depends on geography. Promotions overlap.
Pricing logic is no longer UI behavior. It is a financial boundary.
Subtotal: $0
Shipping: $10
Total: $10
Pricing logic is moved into pure domain functions.
UI renders. Domain computes. State stores.
Rules are testable. Framework-independent. Explicit.
Increased indirection. More cognitive overhead. More structural complexity.
Financial rules now live behind an explicit domain boundary.
// domain/cart.ts
export function calculateSubtotal(cart) {
return cart.reduce(...)
}
export function calculateShipping(subtotal) {
return subtotal > 100 ? 0 : 10
}
// UI
const subtotal = calculateSubtotal(cart)
A regional tax rule changes.
Without a domain boundary, pricing logic is scattered across UI components.
One surface updates. Another does not.
Legal exposure increases. Financial totals drift.
With a protected domain layer, rules change in one place.
When rules carry financial weight, they must be isolated from the interface.