repository pattern
A repository exposes persistence operations needed by the application.
Use this when Domain code depends on storage details that must change independently.
without the term
“Our business logic calls the ORM directly everywhere, so changing how orders are stored touches dozens of files. Can you put storage behind a few clear functions, without wrapping the entire ORM?”
with the term · How do you ask a model for repository pattern?
Introduce a repository only for these application operations. Keep ORM details behind it and verify the real storage contract.
What is repository pattern?
A repository offers the persistence operations the application needs, like findOrder or saveOrder, and hides the ORM behind them. Copying the whole ORM interface into it adds no value.
Why does repository pattern matter when vibe coding?
A wrapper can add maintenance cost without removing any dependency.
How do you do repository pattern?
Define a small application-facing contract and test its required behavior against the real persistence implementation.
What goes wrong with repository pattern?
Re-exporting every query-builder method through another object.