Fellows,
I'm starting a new Perl project, and our team system architect is a guy from Java OO school. I'm trying to help him to understand and use the Perl Class::DBI family, making analogies with J2EE object families so he can understand and model what's going on.

I've implemented a small prototype for part of our application, so I can demonstrate Class::DBI in action. So I wrote something like this (simplified for this article):

package Project::CDBI; use base "Class::DBI"; __PACKAGE__->connection( __DSN__, __USER__, __PASSWORD__ ); 1; package Project::CDBI::User; use base "Project::CDBI"; __PACKAGE__->table( 'user' ); __PACKAGE__->columns( All => qw/ id name login passwd email / ); __PACKAGE__->sequence( 'user_id_seq' ); 1; package Project::Main; use strict; use warnings; use Project::CDBI::User; # many lines of code here... # somewhere here we find a user and change his email. $user = Project::CDBI::User->find_or_create( $user_id ); $user->email( $new_email_addr ); $user->update; Project::CDBI::User->dbi_commit; __END__

And then it happened. The architect asked me to use DAO design pattern to implement the database access, and to use VO (Value Objects) to pass info arround. I just can't point him what object plays the Value Object role and what object plays the Data Access Object role when using Class::DBI.

Given that, a enlightened and wise monk here can please tell me what are the roles each perl object implemented here plays and what should I do to implement that Value Objects and Data Access Objects the architect asked me to?

May the gods bless you all.


In reply to Quite confuse about using Class::DBI to implement Data Access Objects and Value Objects Design Patterns by monsieur_champs

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.