I’ve recently stumbled upon an interesting blog post about when to use an ORM. I found it to be well-written and quite objective, specifically with respect to its model complexity and throughput diagram:
Clik here to view.

Original image taken from this blog post: http://mikehadlow.blogspot.ca/2012/06/when-should-i-use-orm.html
The ORM or not ORM topic will probably never stop showing up on blogs. Some of them are more black and white, such as Jeff Atwood’s Object-Relational Mapping is the Vietnam of Computer Science others are more “50 shades of data access”, such as Martin Fowler’s ORM Hate.
I’m personally impressed by the work ORMs have done for us in times when repetitive SQL started to get boring and CRUD was not yet established. But ORMs do have their caveats as they are indeed leaky abstractions.
The aforementioned article shows in what situations ORMs can pull their weight, and in what situations you better keep operating on a SQL level, using tools like jOOQ, MyBatis, Apache DbUtils, or just simply JDBC.
Read the original blog post here:
http://mikehadlow.blogspot.ca/2012/06/when-should-i-use-orm.html
Other related articles:
- ORM is an Antipattern (analysis, contra ORM)
- ORM is not a choice (promotional article, pro ORM)
- Keeping it Simple (analysis, contra ORM)
- Ten Advantages of an ORM (analysis, pro ORM)
- Your ORM Sucks (rant, contra ORM)
- Should I Use ORM Or Not? Sure. (rant contra ORM-ranters)
- Add yours here…
Filed under: java Tagged: abstractions, Antipattern, caveats, Databases and Persistence, hibernate, java, jooq, jpa, Martin Fowler, model complexity, mybatis, Object-relational mapping, ORM, sql Image may be NSFW.
Clik here to view.

Clik here to view.
