Re:The State of Ruby ORM
by austintaylor on Tuesday November 29, 2011 @05:05PM
(#3292435)
Datamapper implements the active-record pattern. It's the last thing you would expect.
look at it as hints. It's not actually tightly coupled, as m of that stuff is optional sugar that allows for better optimization.
That "sugar" is in the wrong place for a project that names itself after a pattern intended to keep the models and storage separate. If Datamapper actually tried to implement the datamapper pattern, you would've put it in separate mapper classes, not littered around the models.
Fair point. Why don't you create a gist with an example of what the model + hint declarations would look like in separate classes. I'm not convinced that this distinction matters, but I'm sure the DM developers would respectfully take a close look at your insights. They are a really great group, very helpful on IRC, etc.
I would if I had time. Or they could just read the chapter of Patterns of Enterprise Application Architecture that they took the name from - it's the chapter right after Active Record :) Page 165. Martin Fowler went into a decent amount of depth in describing the pattern. His site also has a decent summary available for free.
I don't think this is exactly is lack of awareness on their part, though - as someone else has pointed out, Datamapper actually implements the Active Record pattern. Structurally the two are very different.
After all the entire point of data-mapper is that your objects don't know the details about how they're stored.