[Dbix-class] DBIx::Class as an Object-Relational mapper

Brandon Black blblack at gmail.com
Wed Mar 15 20:12:02 CET 2006


On 3/15/06, techwiseman-perlml at yahoo.com <techwiseman-perlml at yahoo.com> wrote:
>
>  I have been working on a proposal for my employer to restructure our customer-facing application, and am advocating an OO design.  In my research I learned a lot about the Object-Relational impedance mismatch ( http://www.google.com/search?q=Object-Relational+Impedance+mismatch ) discussed, analyzed and combated in many articles on the web.  Looking at the many issues and tradeoffs an Object-Relational mapper looks like the most acceptable alternative.  This is what led me to DBIx::Class in the first place. I have explored a few other APIs including Class::DBI, and have been a bit disappointed in the current state of DBIx::Class's documentation, but still think it's a better alternative than Class::DBI.
>
>  I do recognize that DBIx::Class and Class::DBI are both rather thin ORMs compared to other examples I've seen, and appreciate the extra control and potential added performance that would afford us. I realize that RDBMS don't really include anything that maps directly to inheritance and that any such relationships that may be represented in a database are artificial anyway.  I would still like to present such an interface to the internal object system of the application, while it would really be foreign keys and smoke and mirrors on the RDBMS side of things. I am having a little trouble understanding how to do that with DBIx::Class, and would like to see an example of such a scenario.
>
>  Thank you for all your hard work, the API looks great,
>

Personally, I've always though it was a bit sinful to have automatic
DWIM $object->store_me kinds of things going on just by loading up an
ORM module/library.

There are a lot of similarities between good relational database
design and good OO design, but I think the foundation of any good
application is a solid relational data model first; the code is a
second-class citizen comparatively.

An ORM (DBIx::Class or otherwise) is to me just a convenient OO
interface for manipulating a relational database, rather than
something that should try to "hide" the RDBMS in an seemingly-OO-like
mask of smoke and mirrors.

That's just my personal opinion though, and I'm probably in the
minority in the world (and this list) right now.  :)

-- Brandon



More information about the Dbix-class mailing list