Re: green bean question on singleton php5
| From: | Nathan Nobbe | Date: | Wed, 16 Jan 2008 22:06:14 +0000 |
| Subject: | Re: green bean question on singleton php5 | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-267451@lists.php.net to get a copy of this message | ||
On Jan 16, 2008 4:55 PM, Jochem Maas <jochem@iamjochem.com> wrote:
> Eric Butera schreef:
> > I still don't understand the obsession of a singleton in regards to a
> > db connection. Using a registry is a much better practice I think.
> >
>
> I think I alluded to the registry pattern in my reply above - although I'm
> not
> sure. could you care to ellaborate what you mean by registry?
>
though i havent seen registry defined in any of the few patterns books ive
seen;
i think its supposed to be a list of singletons, essentially; if you want a
'global'
registry that is. and i suppose the registry class would itself be a
singleton as well.
here is a somewhat concrete definition / explanation / example..
http://www.phppatterns.com/doku.php/design/the_registry
-nathan