Hi,

From: "Feng He" <fen...@nsbeta.info>


Hello,

I have a question that, what's the advantage of using an ORM instead of the traditional DBI?


With an ORM the programming code is much elegant and easy to write because you don't need to join SQL strings to compose a full SQL query based on different conditions, but use methods and Perl data structures to do that.

Another advantage is that if your queries don't use some features which are offered by just a single database type, the code you write can be used with more database types, so even if you write your app to work with MySQL, you will be able to use it with PostgreSQL, Oracle or other database types, even those other database types use a different syntax for doing some things.
also.

Another advantage is that you can combine the ORM with other higher level modules like templating systems, form processors and work even easier.

But an ORM won't help you to do that work easier without understanding SQL.


And what's better for DBIx::Class and Class::DBI?

DBIx::Class appeared to solve the issues in Class::DBI and it is the recommended one.

Octavian


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to