Re: app design issue
| From: | Jeroen Houben | Date: | Fri, 15 Aug 2003 14:15:06 +0000 |
| Subject: | Re: app design issue | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7224@lists.php.net to get a copy of this message | ||
Robin Ericsson wrote:
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?
Yes, singleton is the most elegant solution I think. But I don't PEAR::DB has one. MDB does.
HTH
Jeroen