Before I actually took a serious look at Class::DBI, I always thought that it was something like DAO (Data Access Object) in Java. But when I really looked at it, it was not, it was more like a SQL statement generator, or another way to write a SQL statement without knowing the syntax, but then you have to know the syntax of Class::DBI.

I agree that Class::DBI will provide certain help in a way, but not in the sense to keep access close to data.

The DAO's in Java is really what you mentioned, keeping access close to data. The person write DAO needs to know the database table structure, know all the column names etc. But the caller of those DAO's don't need to know those any more, to them, data is data, doesn't matter how it is stored in database.

Class::DBI clearly lacks those merits.

To me, Class::DBI is not a way to keep access close to data, or to hide the table strcutures from the user, but mainly just a way to generate SQL statement.

BTW, in Java, there is nothing similar to this (Even if there is any, it is not popular at all. On the other hand, I doubt that this is a must, and how much benefit it brings to the table.).

Personally I think that the Java way delivers "keeping access close to data".


In reply to Re: A novice's thoughts on applying Demeter to extension code by pg
in thread A novice's thoughts on applying Demeter to extension code by diotalevi

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.