请输入您要查询的百科知识:

 

词条 Data mapper pattern
释义

  1. Implementations

      Java/.NET    Node.js / TypeScript    PHP    Python    Ruby    Elixir    Golang  

  2. See also

  3. References

In software engineering, the data mapper pattern is an architectural pattern. It was named by Martin Fowler in his 2003 book Patterns of Enterprise Application Architecture.[1] The interface of an object conforming to this pattern would include functions such as Create, Read, Update, and Delete, that operate on objects that represent domain entity types in a data store.

A Data Mapper is a Data Access Layer that performs bidirectional transfer of data between a persistent data store (often a relational database) and an in-memory data representation (the domain layer). The goal of the pattern is to keep the in-memory representation and the persistent data store independent of each other and the data mapper itself. The layer is composed of one or more mappers (or Data Access Objects), performing the data transfer. Mapper implementations vary in scope. Generic mappers will handle many different domain entity types, dedicated mappers will handle one or a few.

Implementations

Implementations of the concept can be found in various frameworks for many programming environments.

Java/.NET

  • MyBatis persistence framework
  • Hibernate (NHibernate) persistence framework

Node.js / TypeScript

  • Bookshelf.js library
  • [https://typeorm.github.io/ TypeORM] library
  • [https://dmfay.github.io/massive-js/ Massive.js] library
  • [https://www.prisma.io/ Prisma]

PHP

  • Atlas ORM (data mapper, table data gateway, query builder, and PDO wrapper)[2]
  • Doctrine2 Object Relational Mapper (ORM) and the Database Abstraction Layer[3]

Python

  • SQLAlchemy library

Ruby

  • DataMapper library (Actually this library implemented the Active Record design pattern, its successor, DataMapper 2 (now ROM) aimed to actually implement the design pattern it was named after)

Elixir

  • [https://github.com/elixir-ecto/ecto Ecto] persistence framework

Golang

  • [https://www.prisma.io/ Prisma]

See also

  • Active record pattern
  • Object-relational mapping

References

1. ^{{cite book |last=Fowler |first=Martin |title=Patterns of enterprise application architecture |publisher=Addison-Wesley |year=2003 |isbn=978-0-321-12742-6 |url=https://books.google.com/books?id=FyWZt5DdvFkC&lpg=PA1&dq=Patterns%20of%20Enterprise%20Application%20Architecture%20by%20Martin%20Fowler&pg=PT187#v=onepage&q=active%20record&f=false }}
2. ^{{cite web|url=http://atlasphp.io/|title=Atlas ORM{{spaced ndash |archiveurl=http://atlasphp.io}} Atlas}}
3. ^{{cite web|url=http://www.doctrine-project.org/blog/your-own-orm-doctrine2.html#doctrine2-and-activerecord|title=Doctrine2 and ActiveRecord{{spaced ndash |archiveurl=http://www.doctrine-project.org/blog/your-own-orm-doctrine2.html#doctrine2-and-activerecord}} Doctrine2|publisher=Doctrine2}}
{{DEFAULTSORT:Data mapper pattern}}

1 : Software design patterns

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/13 11:31:29