nmerriweather has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|