app design issue
| From: | Robin Ericsson | Date: | Fri, 15 Aug 2003 14:14:03 +0000 |
| Subject: | app design issue | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-7223@lists.php.net to get a copy of this message | ||
I have this setup:
class A
constructor()
b = new Class B
b->run();
class B
run()
db = new PEAR::DB
do db stuff
if (specialoccasion)
c = new Plugin
c->run()
class C
Does everybody understand this? My problem is that class also needs to
use the db object in class C.
I could pass the db object on the class C as I do it today, but it
doesn't look nice to do it.
Should it place as a global object?
Singleton?
best regards
Robin