Hi Monks,

So I just perused the documentation for Class::DBI ("a convenient abstraction layer to a database") and DBIx::Class ("allows abstract encapsulation of database operations") and I am struggling to see the point of using such a module.

I am not exactly a newbie with perl, although as somebody who learned it in the course of sys-admin/ops type work there was correspondingly less need for making everything into an object. That said, I understand perfectly well the reasoning behind OOP for software development, and a fortiori, modular code in general.

So I know there are dissenters from the OOP camp as a whole. That is not the hornets nest I want to kick at. I'm just wondering what benefit there is to replacing the conciseness of a SQL statement (which can be wrapped up into a method anyways, right?) with what looks like a mess of hashrefs that has to be over-ridden whenever there is something complicated to do anyways.

It seems this is touching on what Wikipedia calls the object-relational impedance mismatch but on my level of experience with these modules (which is admittedly nil) I'd hesitate to call it a "solution" as such. Am I not getting it? Anyone care to explain how this approach has made easy things easy and hard things possible, for them?

Thanks!

In reply to Why use an OO -> SQL mapper module? by MyMonkName

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.