Data access object

This is an old revision of this page, as edited by Ta bu shi da yu (talk | contribs) at 05:52, 30 July 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computer software, a Data Access Object (DAO) is a component which provides a common interface between the application and one or more data storage devices, such as a database or file. The term is most frequently applied to the Data Access Object design pattern.

Why use Data Access Objects?

Data Access Objects are considered best practice. They are a Core J2EE Design Pattern. The advantage of using data access objects is that any business object (which contains application or operation specific details) does not require direct knowledge of the final destination for the information is manipulates. As a result, if it is necessary to change where or how that data is stored that modification can be made without needing to change the main application.

Data Access Objects can be used in Java to insulate an application from the underlying Java persistence technology, which could be JDBC, JDO, EJB CMP, Hibernate, iBatis, or any one of a range of technologies. Using Data Access Objects means the underlying technology can be upgraded or swapped without changing other parts of the application.