A few months ago, I posted a question on passing DB handles through functions and packages here that related to a similar question here

I've realized that this could be better addressed by some sort of intelligent interaction by packages -- one that I can't figure out. Hopefully someone here can help.

I've created a base framework of packages for webapplications under mod_perl that contain functions I often use.

MyFramework
MyFramework::DBIClass
MyFramework::UserClass
MyFramework::FormClass

What I then do, is make another set of packages subclassing the first.

MyWebApp
MyWebApp::DBIClass (isa MyFramework::DBIClass)
MyWebApp::UserClass (isa MyFramework::UserClass)
MyWebApp:: FormClass (isa MyFramework::FormClass)

Here lies the problem:
Everything works GREAT when I pass around lots of info -- like references to the DB configuration. I'm trying to limit all passing around of arguments though -- and need to figure out some way to get all of the various MyFramework packages to access the configuration for MyWebApp::DBI or MyWebApp::Configuration . In the preceding example, I created a webapp called 'MyWebApp' -- though it could also be called 'MyWebApp2' or something similar to better illustrate the problem.

Can anyone suggest some ways in which I can structure this system so that I can limit the references passed around, and have the packages intelligently make queries for the correct info.

2004-11-21 Janitored by Arunbear - fixed links to previous questions


In reply to Intelligent Package Interaction by nmerriweather

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.