While I was at the QCon conference in London a couple of months ago, it seemed that every talk included some snarky remarks about Object/Relational mapping (ORM) tools. I guess I should read the conference emails sent to speakers more carefully, doubtless there was something in there telling us all to heap scorn upon ORMs at least once every 45 minutes. But as you can tell, I want to push back a bit against this ORM hate - because I think a lot of it is unwarranted.
I agree with pretty much everything he says. ORMs solve a hard problem, and there’s often no better solution than one of the open source options if your software needs to interact heavily with a relational database. Just don’t expect to get something for free. Your software will still need testing with a real database and need performance testing if you expect it to work under load.
As Charles pointed out on our work wiki the other day:
Any sufficiently advanced Java ORM contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Hibernate 1.0.
Once you start building all the infrastructure to manage in-memory entities retrieved from the database and cache them effectively in a multi-threaded application, you end up with something very similar to Hibernate. My recommendation: don’t sneer at something until you’ve tried to solve a similar problem from scratch yourself.