Data Access Object

Data Access Object (DAO, English for data access object ) is a design pattern that so encapsulates access to different kinds of data sources ( eg databases, file system, etc.) that the mentioned data source can be replaced without the calling code must be changed. This is the actual program logic are exempt from the technical details of data storage and be flexible. DAO is thus a model for the design of application programming interfaces ( APIs). If a programming language is no separation of interface definition and implementation enables a DAO must implement the interface defined directly.


  • DAOs to abstract access to databases is not complete, as they are not responsible for the transformation of data into the database structure.
  • DAOs are each optimized for a particular storage medium. Access to this item will be made on the prescribed from DAO or to-implement API.
  • DAOs minimize porting effort of an application when changing the storage medium.

Closely related to the Data Access Object design pattern is the transfer object. This assumes the interaction with the DAO, the transformation of the coming from the data source data in the form desired by the application. In object- relational mapping as object-oriented data are transformed into relational form.

Application Examples

The pattern is also found in the J2EE environment. Apple provides a similar concept called Enterprise Objects within the WebObjects.