PRESENTATION OUTLINE
A layer that separates in-memory objects from the database.
Its responsibility is to transfer data between the two and also to isolate them from each other.
With Data Mapper the in-memory objects needn't know even that there's a database present; they need no SQL interface code, and certainly no knowledge of the database schema.
Have you seen something like that?
Not as cool as cake though
Data Mapper "traslates" code Objects into database Entities
A complex Data Mapper handles inheritance and Object composition
Top 5 reasons why Data Mapper rocks!
- Think only about Objects
- Do not worry about model hierarchy
- Easy Composition and complex attributes
- No more SQL!
- Reduce SQL Queries (Lazy Load)