0% found this document useful (0 votes)
2 views2 pages

Data Access Object Pattern

The Data Access Object (DAO) Pattern separates low-level data access operations from high-level business services, promoting a clear separation of logic. It consists of a DAO interface, a concrete class implementing this interface, and a model object for data storage. An example implementation involves a Student model, a StudentDao interface, and a StudentDaoImpl class to demonstrate the pattern's functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Data Access Object Pattern

The Data Access Object (DAO) Pattern separates low-level data access operations from high-level business services, promoting a clear separation of logic. It consists of a DAO interface, a concrete class implementing this interface, and a model object for data storage. An example implementation involves a Student model, a StudentDao interface, and a StudentDaoImpl class to demonstrate the pattern's functionality.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Data Access Object Pattern

Data Access Object Pattern or DAO pattern is used to separate low level data accessing API or operations from high level business
services. Following are the participants in Data Access Object Pattern.
 Data Access Object Interface - This interface defines the standard operations to be performed on a model object(s).
 Data Access Object concrete class - This class implements above interface. This class is responsible to get data from a
data source which can be database / xml or any other storage mechanism.
 Model Object or Value Object - This object is simple POJO containing get/set methods to store data retrieved using DAO
class.

DAO stands for Data Access Object. DAO Design Pattern is used to separate the data persistence logic in a separate layer. This
way, the service remains completely in dark about how the low-level operations to access the database is done. This is known as
the principle of Separation of Logic.

Implementation
We are going to create a Student object acting as a Model or Value [Link] is Data Access Object
[Link] is concrete class implementing Data Access Object Interface. DaoPatternDemo, our demo class, will
use StudentDao to demonstrate the use of Data Access Object pattern.

You might also like