views:

153

answers:

3

Hi,

My question is regarding ORM and JDBC technologies, on what criteria would you decide to go for an ORM technology as compared to JDBC and other way round ?

Thanks.

+3  A: 

Complexity.

ORM If your application is domain driven and the relationships among objects is complex or you need to have this object defining what the app does.

JDBC/SQL If your application is simple enough as to just present data directly from the database or the relationships between them is simple enough.

The book "Patterns of enterprise application architecture" by Martin Fowler explains much better the differences between these two types:

See: Domain Model and Transaction Script

OscarRyz
+1. My own way of putting it is that you have to have a sense of when the large constant cost of ORM "pays for itself".
Jonathan Feinberg
I've got to agree with this - but I'd also add that there are times when using both within a single application makes sense.
Chris R
A: 

It also depends on the learning curve.

Ebean ORM has a pretty low learning curve (simple API, simple query language) if you are happy enough with JPA annotations for mapping (@Entity, @Table, @OneToMany etc).

Rob