Re:Post-Architecture: Premature Abstraction Is the Root of A...
by nanomonkey on Friday July 19, 2024 @12:21AM
(#41001986)
OO and Relational databases really don't mix well, so much that there are wikipedia articles on the subject [0].
ORMs create some of the worst SQL table layouts that I've ever seen, not to mention they generally cause tons of N+1 query problems.
[0] https://en.wikipedia.org/wiki/Object%E2%80%93relational_impe...
Re:Post-Architecture: Premature Abstraction Is the Root of A...
by arendjr on Friday July 19, 2024 @12:39AM
(#41002042)
I actually have nothing against objects and methods, but that’s a very limited subset of OO. I prefer to use algebraic data types for domain modeling, and giving them methods is totally fine too. But I do prefer them to be immutable in most cases, which is also quite counterintuitive from an OO perspective.
You have to model your business domain in software one way or another anyway. Why should it be bad to try to be more methodical about it using OO methods? We do it with relational databases all the time where tables are pretty similar to objects.