| ▲ | tengbretson an hour ago | |||||||
I don't disagree with any of the major gripes people have with orms and I find SQL to be much cleaner in a lot of circumstances. That being said, if orms didn't force you to explicitly define your domain models about 60% of developers would simply never do it. And you would see differently structured, ad-hoc interfaces defined all over the code base completely entangled with whatever action they are trying to perform. ORMs being a forcing function for domain modeling is enough benefit for me that it outweighs all of their obvious limitations. | ||||||||
| ▲ | sandreas an hour ago | parent | next [-] | |||||||
Additionally I think the migration management that most ORMs support are also a good thing. Defined and type-safe forward and backward strategies are helpful in most cases, especially if you'd like to support more than one DBMS. I personally think that ORMs are good for management and simple CRUD cases, QueryBuilders are good for managing more complex queries while still being secure / type-safe and for everything else a thin database abstraction layer for native SQL queries with parameters / prepared statements is still required especially for performance use cases. | ||||||||
| ▲ | ibejoeb 40 minutes ago | parent | prev | next [-] | |||||||
Wouldn't you consider defining the schema doing the domain modeling? I think ORMs do too much. I want to control the querying, or, more precisely, I want to control the SQL that goes to the planner. The good ones largely do allow for this, but I can't think of one that has innate support for vendor-specific features. What I do appreciate is that they handle the boilerplate like managing connections, preparing statements, setting parameter values, and mapping database types back to client types. | ||||||||
| ||||||||
| ▲ | Kinrany an hour ago | parent | prev [-] | |||||||
I'd rather take a mess of ad-hoc interfaces. Forcing people to do domain modeling does not go well. | ||||||||