I have been placed in the precarious position of trying to figure out how to do something and I am not exactly sure how to do it. And I am running this by all of you to see if it is a good idea or not.

I have to write a series of cgi scripts much like the VA hospital ( for talking to them was the concept for my system ) so that rhe system has a core set of data for each user ( address, name, the usual ) and then each department has additional data that relates to that table. If this was a hospital the example would be patient data is the core and the eye doctor would have files that relate to his/her eyes. And each deaptment would be able to relate. And sometimes data would be shared with other departments. Like making sure they don't have 2 surgeries at the same time.

A database makes the organizing of the data in such a way possible. And most of that data in above example is related to the code user data.

What I am asking your opnions on is I need to give the people who are designing each of the departments data in my version an easy way to access the core user data, and update ect it.

I was thinking can an object make it's own database connection? Like when new is called it connected to the database inside the object and suplied the programmer with all the methods they needed to get and edit the data.

Is this a good way of doing in and having all of the shared data resources get their own objects? What do you think and are there any examples of objects making their own database connections through DBI?

Thanks in advance

In reply to Object DBI concepts by Angel

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.