liveBook · Manning

Data access object

A data access object is a component that encapsulates operations for accessing and manipulating persistent data, separating persistence concerns from application logic.

How 2 Manning books explain it

Java Persistence with Spring Data and Hibernate epub

The data access object pattern separates an abstract data-access interface from the implementation details of communicating with a database.

How it is used
Separates application access operations from database communication in Spring-managed JPA or Hibernate persistence applications.
How deep it goes
Builds interfaces and implementations, then addresses injection, transactions, and reusable base classes rather than stopping at a pattern definition.
Examples
Uses ItemDao and BidDao interfaces, their Spring-managed implementations, and an application service that injects ItemDao.
What you can do after
Build it from scratch with a Spring-managed JPA DAO, or evaluate whether a generated Spring Data JPA repository is sufficient.

Read how Java Persistence with Spring Data and Hibernate epub explains data access object →

Akka in Action, Second Edition

A data access object is an application-layer object that encapsulates operations for accessing a data store.

How it is used
Encapsulates database statements behind an abstraction used by controllers for business logic.
How deep it goes
Traces failures, concurrency risks, multi-table writes, and slower database-backed testing without showing DAO implementation code.
Examples
Uses Conversation and Message insertion, duplicate-record risks, database outages, and database-backed tests.
What you can do after
Diagnose database-operation failures and inconsistent multi-step writes when replacing in-memory objects with DAOs.

Read how Akka in Action, Second Edition explains data access object →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.