3 ms·
look at it as hints. It's not actually tightly coupled, as m of that stuff is optional sugar that allows for better optimization.
by grandalf 15y ago
look at it as hints. It's not actually tightly coupled, as m of that stuff is optional sugar that allows for better optimization.
- vidarh 15y agoThat "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.
- grandalf 15y agoFair 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.
- vidarh 15y agoI 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.