tags:

views:

52

answers:

2

i've read a lot about ORM but wondering if there are side by side comparison examples between an ORM like doctrine and SQL so that you could see what is more easier to maintain?

couldn't find such comparisons in google.

+1  A: 

I don't know of such code comparisons, but personally I prefer using an ORM since it allows me to express queries in "business" terms, instead of "table" terms.. For example

Query(Customer).filter_by(Customer.address.has(Address.state == 'Whatever'))
Joril
+2  A: 

"easier to maintain" is subjective. ORM always has some limitations. It is attempt to put flat relational SQL into procrustean bed of OOP. If you're big OOP fan, ORM is probably for you. Otherwise go for SQL.

In the other words, ORM make general purpose tasks simpler but any unusual task become pain in the neck.

Col. Shrapnel