Datamapper
   HOME

TheInfoList



OR:

DataMapper is an object-relational mapper
library A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
written in
Ruby Ruby is a pinkish-red-to-blood-red-colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapph ...
that follows the
active record pattern In software engineering, the active record pattern is an architectural pattern. It is found in software that stores in-memory object data in relational databases. It was named by Martin Fowler in his 2003 book ''Patterns of Enterprise Application ...
even though the name implies it follows the
data mapper pattern 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''. The interface of an object conforming to this pattern would include f ...
. While DataMapper 1 may not have achieved total decoupling between object and database suggested by the data mapper pattern, it appears DataMapper 2 intended to change this (''a la'' Virtus, a library adapted from DataMapper). The DataMapper 2 project was renamed before launch and was released as Ruby Object Mapper (ROM) in August 2013. Some features of DataMapper: * Eager loading of child associations to avoid (N+1) queries * Lazy loading of select properties, e.g., larger fields * Query chaining, and not evaluating the query until absolutely necessary (using a lazy array implementation) * An API not too heavily oriented to SQL databases DataMapper was designed to be a more abstract ORM, not strictly SQL, based on Martin Fowler's enterprise pattern. As a result, DataMapper adapters have been built for other non-SQL databases, such as CouchDB, Apache Solr, and webservices such as Salesforce.com.


References


External links


DataMapper homepage
Object–relational mapping {{database-software-stub cs:Data Mapper