Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://martinfowler.com/eaaCatalog/dataMapper.html" rel="nofollow">Data mapper</a> saves the data from (and restores to) <a href="http://c2.com/cgi/wiki?DomainObject" rel="nofollow">domain object</a> directly, while <a href="http://www.oracle.com/technetwork/java/dataaccessobject-138824.html" rel="nofollow">data access object</a> would be used as intermediary for exchange of information between domain object and storage abstraction.</p> <p><code>&lt;update&gt;</code> <em>The main difference between two approaches is that data mapper temporary takes control of the domain object, while data access object either receives data indirectly (through some higher level abstraction, like Service) or is controlled (and in some implementations, even instantiated) by domain object.</em><code>&lt;/update&gt;</code></p> <p>Neither of patterns is remotely related to <a href="http://martinfowler.com/eaaCatalog/activeRecord.html" rel="nofollow">active record</a> (anti)pattern, which combines domain logic and storage abstraction in single instance, thus breaking <a href="http://en.wikipedia.org/wiki/Single_responsibility_principle" rel="nofollow">SRP</a>.</p> <p>And none of mentioned patterns are tied to ORMs. Some ORMs try to use the above mentioned pattern for implementation, but they usually do a quite bad job at that.</p> <p>Most of, what you call, "modern frameworks" use active record pattern and call the instances of it "models", which extreme simplification of concept, perpetuated by Rails.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload