2 ms·
> ORMs are powerful, because they let you say less and do more To me this is a bonus. The real deal is that ORMs allow you to write queries as "first-class" co
by lloeki 15y ago
> ORMs are powerful, because they let you say less and do more
To me this is a bonus. The real deal is that ORMs allow you to write queries as "first-class" components of the language, hence benefiting from language features such as type checks, duck-typing, factoring, static analysis even, and more.
Compare this to stitching strings (however parametrized they are) and manually coercing your object values to strings.
This is where, IMHO, ORMs like ActiveRecord and Arel shine, as they give you access to each building block (form connection.execute to .quoted_table_name to .to_sql) so that you can place yourself at whatever level of abstraction between the two worlds you may need.
- nahname 15y agoDon't forget the whole other side of it. http://en.wikipedia.org/wiki/Object-relational_impedance_mismatch http://en.wikipedia.org/wiki/Object-relational_impedance_mis...