What, *specifically*, makes DataMapper more flexible than ActiveRecord?

Posted by Billy ONeal on Stack Overflow See other posts from Stack Overflow or by Billy ONeal
Published on 2011-02-17T18:17:54Z Indexed on 2011/02/18 7:25 UTC
Read the original article Hit count: 146

Filed under:
|
|
|

I'm comparing Doctrine 2 and Propel 1.5/1.6, and I'm looking in to some of the patterns they use. Doctrine uses the DataMapper pattern, while Propel uses the ActiveRecord pattern. While I can see that DataMapper is considerably more complicated, I'd assume some design flexibility comes from this complication. So far, the only legitimate reason I've found to use DataMapper over ActiveRecord is that DataMapper is better in terms of the single responsibility principle -- because the database rows are not the actual objects being persisted, but with Propel that doesn't really concern me because it's generated code anyway.

So -- what makes DataMapper more flexible?

© Stack Overflow or respective owner

Related posts about php

Related posts about database