4 ms·
My take on ORMs (and OOP) is that they create a harmful illusion that data is just a bunch of "objects" that can be used in some abstract "reusable" way without
by dpc_pw 6y ago
My take on ORMs (and OOP) is that they create a harmful illusion that data is just a bunch of "objects" that can be used in some abstract "reusable" way without care for the concrete form it have to be stored (relations, indices, collections/tables) to support efficient computation.
See https://twitter.com/dpc_pw/status/1240719977071575040 https://twitter.com/dpc_pw/status/1240719977071575040 for how this works in practice.
- imtringued 6y agoIf you ask Gavin King or other creators of ORMS their complaints is that they lower the barrier of entry so much that even people who know nothing about databases end up using them. A lot of people seem to have the impression that the ORM is supposed to solve all their problems when an ORM is more of a convenience thing. You have to know the limitations of your database and design your database structure based on those limitations first. Your domain objects (objects representing data in the database) are supposed to match the design of your database, not the other way around. People like to call this a leaky abstraction but I think it's far more boring. Know your tools (both the ORM and the database). It will be worth it. Don't hesitate to use raw SQL if the ORM doesn't play along.