Jump to content

DataMapper

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gyngve (talk | contribs) at 15:14, 4 September 2009 (linked to other wikipedia articles). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Datamapper is an object-relational mapper library written in Ruby and commonly used with Merb. It was developed to address perceived shortcomings in Ruby on Rails' ActiveRecord library.

Some features of Datamapper:[1]

  • 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.[2] As a result, people have build Datamapper adapters for other non-SQL databases, such as CouchDB[3], Apache Solr[4], and webservices such as Salesforce[5].


References

  1. ^ http://datamapper.org/doku.php?id=why_datamapper
  2. ^ Fowler, Martin (2002). Patterns of Enterprise Application Architecture. Addison-Wesley. ISBN 0-321-12742-0. {{cite book}}: Unknown parameter |coauthors= ignored (|author= suggested) (help); Unknown parameter |month= ignored (help)
  3. ^ http://github.com/kabari/dm-couchdb-adapter/tree/master
  4. ^ http://github.com/lritter/dm-solr-adapter/tree/master
  5. ^ http://github.com/halorgium/dm-salesforce/tree/master