Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My personal gripe about ORMs is that they have two main usage patterns, and each of them has major drawbacks.

The first pattern, common in frameworks like Django, is to cram the business logic into the ORM instance objects. This creates a tight coupling between the two separate concerns (business logic and data persistence), and will cause problems as soon as the two structures deviate from each other.

The second pattern is to keep the ORM as a purely data storage layer, which is much more flexible but commonly causes duplication of nearly identical structures in separate layers.



That's only a pattern though, and it's not actually coupled to the ORM. It's a convention. It's a bad habit.

No one should do that.

The second pattern is also awful. Why would you do that.


Totally agree on the first pattern.

For the second, I don't see how skipping the ORM avoids that duplication. Presumably you still need to map your database fields to object attributes.


The old Data Mapper vs Active Record debate.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: