What I did was all my Objects that talk to the database, inherit from one module. That module has an 'import' method( that gets called automatically), where it will attempt to create a database handle if one does not already exists. Then I share the database handle with a dbh() method from the base class.
So this allows only my objects to have just one dbh(). without having to pass a $dbh around.
In reply to Re: question on OO design and object composition
by Herkum
in thread question on OO design and object composition
by Qiang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |