System Design
15. Software Design PatternsAnimated walkthrough
Data Mapper Pattern
Moves data between objects and the database.
The idea
The mapper keeps domain objects free from database knowledge.
Watch it work
The steps light up one at a time. Use the controls to pause or step through.
- 1Domain objects are plain
- 2The mapper loads and saves
- 3SQL stays in the mapper
- 4Tests need no database
1/4
Step by step
- 1Domain objects are plain
- 2The mapper loads and saves
- 3SQL stays in the mapper
- 4Tests need no database
Where it is used
ORMs like Hibernate.
Watch out for
Extra layer to maintain.