Data Access Object
Adapt a uniform interface to access multiple databases like relational, unrelational, object-oriented, etc.
Where to use & benefits
- Need to access multiple data sources like legacy systems, B2B, LDAP, and so forth.
- Lack of uniform APIs to address the requirements to access disparate systems.
- Persistent storage APIs vary depending on the product vendor.
- Adapt and encapsulate all access to the data source.
- Hide the data source implementation details from its clients.
- More portable and less code dependencies in components.
- Solve differences in the APIs which is used to access different persistent storage mechanisms.
- Not useful for container-managed persistence.
- Related patterns include
See Sun's code sample
Return to top