4 ms·
They (and maybe you?) are missing the point of the Law of Leaky Abstractions here. The point is that no matter how good your abstraction there will be corner c
by cletus 7y ago
They (and maybe you?) are missing the point of the Law of Leaky Abstractions here.
The point is that no matter how good your abstraction there will be corner cases where it gets in the way. This is also a great example of the perfect being an enemy of the good. Some people will try to get that last gap out of their abstraction to the point of it then becoming a little bit worse in all cases and still not being perfect.
The point is that your abstraction shouldn't get in your way. It should be easy to bypass when you need to.
The problem with ORMs in particular is that this tends to be impossible. Any ORM I've used has added a caching layer so then you can't run raw SQL queries and the ORM is never as expressive enough as raw SQL. Sometimes you just want a subset of columns but ORMs don't tend to support that since a table is mapped to an object and it's either all or nothing.
Years ago, this is why I eschewed the likes of Hibernate and preferred things like iBatis.
- tomnipotent 7y ago> Sometimes you just want a subset of columns There isn't a mature ORM I know of that doesn't support this, as either partial bindings to the mapped object (with empty properties) or whatever k/v primitive is supported by the language.