Java data Access Object pattern

Source: Internet
Author: User

Data Access object patterns or DAO patterns are used to decouple low-level data access APIs or operations from advanced business services. The following are participants in the data Access object pattern.

    • data Access Object Interface -this interface defines the standard operations to be performed on model objects.

    • data Access Object Concrete class -This class implements the above interface. This class is responsible for getting data from a data source, which can be a database/xml or any other storage mechanism.

    • model object or Value object -This object is a simple pojo that contains methods for storing data retrieved using the DAO class get/set .

Implementing an instance

In this will create an object as a Model or Value object StudentStudentDaois the data Access object interface. StudentDaoImplis the concrete class that implements the interface of the data Access object. Daopatterndemo This is a demo class that will use the StudentDao presentation using the data Access object pattern.

The structure of the data Access object pattern sample is as shown in-

Click on the link to view the details

Java data Access Object pattern

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.