question of Object
| From: | Yann Larrivee | Date: | Mon, 19 May 2003 22:25:11 +0000 |
| Subject: | question of Object | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-148196@lists.php.net to get a copy of this message | ||
Hi, i have a good question on objects.
I have the fallowing classes Page, Elements,Menu,Product , Var (containt
the post, get, session...) , Db and Error
Page is created once, and i beleive that Db should be created once too.
But at the moment it is created in every class that needs to execute a
query.
I dont find it too nice to do aggregation inside of every class. So i
would like to put this Class on a higher level.
Avisouly i dont want to do Db to extend all the classes because it would
not be to pretty either.
Plus using globals,... hummm
So is there a way to do what i am looking for without using globals and
having Db extend every class that do a connection to the Database ?
Thanks
Yann Larrivee