4 ms·
ORMs try and solve a hard problem, and the devil is in the detail. https://martinfowler.com/bliki/OrmHate.html https://martinfowler.com/bliki/OrmHate.html
by joncrocks 9y ago
ORMs try and solve a hard problem, and the devil is in the detail.
https://martinfowler.com/bliki/OrmHate.html https://martinfowler.com/bliki/OrmHate.html
- marcosdumay 9y agoIt surely is hard. But is it worth solving? The price you pay for a one-size-fits-all solution is that you lose the flexibility of arranging your queries the way you want. You'll automatically lose a lot of performance (that is not always important), but you also lose a kind of code clarity. If you don't get a one-size-fits-all solution, you will have to write the translations by yourself. That leads to more code, but in a better structure because you don't need to beat your code until it fits the ORM's model. All said, I do think an ORM is not something useful by itself, but may be part of a very useful solution. Python Django's CRUD generation and Haskell Persistent (not really ORM, but very similar) type checking are examples of that.