Re: singleton mathod name (do pear packages create their own seperate DB connections?)

From: Date: Wed, 23 Apr 2003 11:32:08 +0000
Subject: Re: singleton mathod name (do pear packages create their own seperate DB connections?)
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-15378@lists.php.net to get a copy of this message
> Lukas Smith wrote: >> 2) make singleton optional: MDB::singleton($dsn, $options) > > am i right that PEAR defines the method, which gets you a singleton > instance is called "singleton"? > I am just asking to get a clear definition, since we are trying to > make some common method names unique here, right? > If there is no definition yet, i might suggest "getInstance", but that > is just a personal preference. > Well I think singleton() is already being used here and there. Also getInstance() doesn't really explain the principle properly. I mean, "new" does also gets you an instance, but singleton (as the name implies) makes sure there is always a *single* instance of the class. Jeroen

« previous php.pear.dev (#15378) next »