1 of 19

Slide Notes

DownloadGo Live

Data Mapper

Published on Nov 18, 2015

No Description

PRESENTATION OUTLINE

Data Mapper

Data Source Architectural Patterns
Photo by zbdh12

A layer that separates in-memory objects from the database.

Photo by michelle@TNS

Its responsibility is to transfer data between the two and also to isolate them from each other.

How does that look like?

Class Diagram

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?

ORM

Untitled Slide

Object Relational
MAPPING

Photo by kmerenkov

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)

Show me the code!

Untitled Slide

Untitled Slide

Untitled Slide

Untitled Slide

Photo by Shardayyy