2015-08-13 23:54:40 +02:00
|
|
|
---
|
|
|
|
layout: pattern
|
|
|
|
title: Data Access Object
|
|
|
|
folder: dao
|
2015-08-15 18:03:05 +02:00
|
|
|
permalink: /patterns/dao/
|
2019-12-13 21:09:28 +02:00
|
|
|
categories: Architectural
|
2015-09-24 12:23:02 +05:30
|
|
|
tags:
|
2019-12-13 21:09:28 +02:00
|
|
|
- Data access
|
2015-08-13 23:54:40 +02:00
|
|
|
---
|
|
|
|
|
2016-01-03 21:14:30 +01:00
|
|
|
## Intent
|
|
|
|
Object provides an abstract interface to some type of database or
|
2015-08-13 23:54:40 +02:00
|
|
|
other persistence mechanism.
|
|
|
|
|
2019-12-07 20:01:13 +02:00
|
|
|
## Class diagram
|
2015-08-13 23:54:40 +02:00
|
|
|

|
|
|
|
|
2016-01-03 21:14:30 +01:00
|
|
|
## Applicability
|
|
|
|
Use the Data Access Object in any of the following situations
|
2015-08-13 23:54:40 +02:00
|
|
|
|
|
|
|
* when you want to consolidate how the data layer is accessed
|
2015-08-15 18:03:05 +02:00
|
|
|
* when you want to avoid writing multiple data retrieval/persistence layers
|
2015-09-24 12:23:02 +05:30
|
|
|
|
2016-01-03 21:14:30 +01:00
|
|
|
## Credits
|
2015-09-24 12:23:02 +05:30
|
|
|
|
2020-07-06 13:31:07 +03:00
|
|
|
* [J2EE Design Patterns](https://www.amazon.com/gp/product/0596004273/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0596004273&linkCode=as2&tag=javadesignpat-20&linkId=48d37c67fb3d845b802fa9b619ad8f31)
|