Skip to catalogue

57

separation of concerns

UI does not own the rule. The rule does not own SQL. Each file has one reason to change.

What is separation of concerns?

Separation of concerns splits a system by what changes together: presentation, domain rule, persistence, transport. A change to the button should not rewrite the invariant.

Why does separation of concerns matter when vibe coding?

A model’s default is one file that fetches, decides, and renders. The next prompt then edits all three. Name the boundary or every slice becomes a ball of mud.

How do you do separation of concerns?

Before generating, name the layers for this slice: handler, rule, store. Tell the model which file owns which. Reject a function that does all three.

How do you ask a model for separation of concerns?

Separate concerns. The handler parses input. The domain function decides. The store writes. Do not put SQL or JSX in the rule.

What goes wrong with separation of concerns?

Six folders and one function that still does everything, imported across them. Folders are not boundaries.

adjacent