[sf-perl] ORM vs. DBI

Joseph Brenner doom at kzsu.stanford.edu
Sun Feb 27 12:08:03 PST 2011

Michael Friedman <friedman at highwire.stanford.edu> wrote:

> I finally got around to reading up on and trying out DBIx::Class. It looks pretty neat, but after loading up a complex DB (108 tables) and writing a short test script, I really don't understand why you'd want to use it over using just regular DBI and SQL. Maybe it's because I knew SQL before I knew Perl and I'm training in looking at things in a SQL way, but I'm not so sure.
> So I'd like to throw the floor open to discussion. Why would you want to use DBIx::Class (or any Object-Relational Manager) instead of writing classes that call the DB directly through DBI?

Myself, I'm essentially on the same side of the fence that you are.
My preferred method of development is to start with data modeling,
work up a schema, write the standard SQL I expect to use to access the
schema, then write some perl methods as wrappers around the SQL.
And when I'm done, I don't expect my code will have trouble scaling up.

As I understand it, the ORM devotees claim they can get something
working faster than someone like me can -- and that's quite possible,
my productivity could be better, certainly on my solo projects -- and
when they're done they'll have something that at least works as a
prototype or for light-duty applications (which are, after all
relatively common, most of us are not working on the next facebook).

More information about the SanFrancisco-pm mailing list