top | item 33027047

(no title)

ajgrover | 3 years ago

Many/most ORMs (the ones that follow the ActiveRecord pattern) do this as well though. I prefer to avoid mixing concerns and use datamapper-based ORMs myself, but what GP wrote is fundamentally not that different than what a lot of ORMs do.

discuss

order

JustLurking2022|3 years ago

I'd dispute "most", as it does not match my experience across a number of languages. Yes, active record sorta does it but, as best I recall, those methods are all implemented generically as mixins, so not actually a part of the data object. This seems to be advocating for data specific queries to be added to each class.

ajgrover|3 years ago

Rails and Django are both AR, and are still probably the two most widely used backend frameworks, for better or for worse.

I don’t disagree with the overall point you’re making, I’m just pointing out that it’s very common