jargon

Design patterns·Objects and the database between them

there is one class per table with find, insert, update and delete on it, and the method names match the storage.

Data access object

Also calledDAO, data access layer

An object that encapsulates access to a particular data source, exposing operations shaped by the storage rather than by the domain. It is older, broader and less opinionated than the repository, and in most codebases the two words are used interchangeably — which is fine as long as everyone agrees which of the two things they actually built. The distinction matters when a repository starts returning rows or a DAO starts enforcing invariants.

Commonly confused with