Hacker News new | ask | show | jobs
by gnaritas 3339 days ago
> I use OOP to construct good gateways into my tables.

That's all an ORM is, a good default gateway to the tables that you don't have to write by hand.

3 comments

ORMs (i.e. Hibernate) try to hide the database. You change the objects and they are magically saved. See http://stackoverflow.com/questions/20863150/in-the-context-o...
I've written ORM's, I don't need them explained to me, and no all ORM's don't try and hide the database, that's just one pattern. Others like ActiveRecord simply try and make life simpler without complete hiding behind so much magic you can't figure out what's going on. ORM's abstract the database, that's not the same as hiding the database.
Except for the times when they load all columns into memory and then you programmatically discard almost everything because you really just needed Person#name.
An ORM is a gateway...not a good gateway.
Most disagree, hence the popularity of ORM's.