2016-04-06 13:14:10 +05:30
|
|
|
---
|
|
|
|
layout: pattern
|
|
|
|
title: Data Mapper
|
|
|
|
folder: data-mapper
|
|
|
|
permalink: /patterns/dm/
|
|
|
|
categories: Persistence Tier
|
|
|
|
tags:
|
|
|
|
- Java
|
|
|
|
- Difficulty-Beginner
|
|
|
|
---
|
|
|
|
|
|
|
|
## Intent
|
|
|
|
A layer of mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
## Applicability
|
|
|
|
Use the Data Mapper in any of the following situations
|
|
|
|
|
|
|
|
* when you want to consolidate how the data layer is accessed
|
|
|
|
* when you want to avoid writing multiple data retrieval/persistence layers
|
|
|
|
|
|
|
|
## Credits
|
|
|
|
|
|
|
|
* [Data Mapper](http://richard.jp.leguen.ca/tutoring/soen343-f2010/tutorials/implementing-data-mapper/)
|