Oh great makers of Heroic Perl,

I am trying to build a system, and as I sit here in my dark corner all by myself contemplating the possiblities, I am struck that I need some guidence.

As part of the exercise in making this program/system, I am using Object Oriented Perl modules. This is an effort to deepen my understanding of the subject. I am also using a database to keep the data persistent.

Sorry for the vagueness, but the specifics have little to do with my question.

What would be the best way to create an object which in part would have member data based on the data from a table. I want to create this so that as columns are added or deleted from the table the code in the object need not be changed.

Let me give a generic example, if I may. My table has columns:

a b c d

I retrieve data from the table into a hash, and use this hash to create the new object. The new object has this data, plus addition data from other tables or specific settings. I want to leave this open-ended so it can all be driven by the db.

I know how to create objects and all that, but I have never done it in this way. Is it possible, and if so, can anyone make suggestions on the best approach?

I lay down at the alter of the monks awaiting their wisdom.

(Ya think, I grovelled enough?)

Edit ar0n -- removed excessive <code> tags


In reply to OO Perl and Design Issues by jonjacobmoon

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.