separation of concerns
Separate responsibilities that change for different reasons.
Use this when One handler mixes transport, business rules, and persistence details.
without the term
“This one route handler parses the request, applies all our discount rules, and writes to the database. When I fix a rule I have to fix it in three places. Can you split it up sensibly?”
with the term · How do you ask a model for separation of concerns?
Separate this business rule from HTTP parsing and persistence. Test the rule directly and verify both existing callers still use it.
What is separation of concerns?
Code that changes for different reasons, such as HTTP parsing, business rules, and database access, lives in different places so one can change without touching the others.
Why does separation of concerns matter when vibe coding?
A generated fix can duplicate a rule across unrelated entry points.
How do you do separation of concerns?
Extract the responsibility that has multiple callers or independent reasons to change.
What goes wrong with separation of concerns?
Moving code into more folders without changing its dependencies.