Have a singleton hold your database connection (roll your own or use something like Class::Singleton). The User and Company classes use that singleton to get access to the database handle.
Keep in mind, however, that there may be reentrancy issues if (for example) you need to have multiple active statement handles simultaneously (depending on your database, and presuming you're using DBI).
In reply to Re: How can I avoid creating two instances of the same object
by Fletch
in thread How can I avoid creating two instances of the same object
by beachguy82
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |