Data Mapper Pattern
This pattern belongs to Data Source Architectural Patterns Catalog and this Catalog belongs to Patterns of Enterprise Application Architecture . Intent A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself. Mapper means an object that sets up a communication between two independent objects. 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 Explanation The Data Mapper is a layer of software that separates the 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. How...