---
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

![alt text](./etc/data-mapper.png "Data Mapper")

## Applicability
Use the Data Mapper in any of the following situations

* when you want to decouple data objects from DB access layer 
* when you want to write multiple data retrieval/persistence implementations

## Credits

* [Data Mapper](http://richard.jp.leguen.ca/tutoring/soen343-f2010/tutorials/implementing-data-mapper/)

---
layout: pattern
title: Data Mapper
folder: data-mapper
permalink: /patterns/data-mapper/
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

![alt text](./etc/data-mapper.png "Data Mapper")

## Applicability
Use the Data Mapper in any of the following situations

* when you want to decouple data objects from DB access layer 
* when you want to write multiple data retrieval/persistence implementations

## Credits

* [Data Mapper](http://richard.jp.leguen.ca/tutoring/soen343-f2010/tutorials/implementing-data-mapper/)

Fix permalink to represent its current dir
Fix permalink to represent its current dir

Otherwise the picture cant be found, as the jekyll build process will put this file in a 'dm' directory and the other stuff like resources in a 'data-mapper' directory (because resources dont have permalink specified they are served static)