Frontend DDD Stops Small Feature Requests From Wrecking Your Codebase
Frontend teams keep hitting the same wall: a small product ask forces a component rewrite because business rules are baked into JSX and event handlers. DDD in the frontend gives those rules a single home that survives UI churn and framework changes, cutting the cost of iteration on complex B2B or e-commerce surfaces.
A single product requirement—grouping cart items by delivery type—turns a clean React component into a tangle of inline filters, payload assembly, and conditional checks. The root cause isn't the requirement itself; it's that business knowledge lives scattered across components, hooks, and utility functions, with no stable entity to carry it. When the technical model doesn't match the domain model, every business change forces a redesign of the UI code.
Moving to a rich domain model fixes this. A `CartLine` class encapsulates not just data but also computed properties like `amount`, `isDailyDelivery`, and `canSubmit`, plus validation logic. A mapper isolates backend DTO changes from the domain, and domain services handle cross-entity strategies like split-delivery decisions. An interaction model hook orchestrates the use case—fetching data, calling domain logic, submitting—so the view layer becomes a thin shell that only renders state and delegates actions.
The payoff is two-fold: business changes update the domain layer without cascading into views, and the domain code stays reusable across web, mobile, or even framework migrations. The approach isn't a silver bullet—simple CRUD pages don't need it—but for systems where business complexity keeps outpacing the component tree, it stops the redesign-death-loop cold.
Most frontend architecture advice focuses on component composition and state management, but the real source of rot is business logic without a permanent address—DDD gives it one that outlives any particular UI.
The article's distinction between utility functions and domain services is underrated: a price formatter is a util, but a split-delivery strategy is domain knowledge, and treating them the same is how codebases become unreadable.
Frontend DDD doesn't require the full ceremony of backend DDD—no repositories, no aggregates in the Evans sense—just the discipline to ask 'does this logic belong to the business or the UI?' before writing it.