

Ask HN: Why do people use hibernate (or any ORM)? - tcarnell

I dont get it. Why is the everybody so keen on extending the development time of a project by using Hibernate? what are the real benefits of hibernate? Please dont say 'database independance' because this can be acheived simply with Spring and JDBC - along with connection pooling and transactions management etc.<p>Why do people think the concept of a foreign key is analgeous to class relationships? Why do people want their database/storage/persistance layer to bleed into their domain/application layer?<p>AND would we be doing things differently if database vendors supported a 'standard' SQL?
======
profquail
I've been using NHibernate + Castle ActiveRecord for a few small/medium
projects over the past year, and I find that it significantly speeds up my
development process. My object model may be "contaminated" now, but if I'm
getting my work done that much faster (plus the added benefit of database
vendor independence), I don't really see the downside. Perhaps if you have a
really complex database model, that's one thing...but in most cases, it's not.

Would people do things differently if there were an adhered-to SQL standard?
Probably not, since using an ORM still saves you development time since you
don't need to write a bunch of fairly routine code.

A better solution might be to have a code-generation tool that writes the code
by hand but doesn't ruin your business object model.

