Re: green bean question on singleton php5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 16, 2008 4:13 PM, Nathan Nobbe <quickshiftin@xxxxxxxxx> wrote:
> On Jan 16, 2008 3:59 PM, Jochem Maas <jochem@xxxxxxxxxxxxx> wrote:
>
> > given that dbaccess doesn't extend mysqli instantiation of dbaccess is
> > completely
> > pointless no?
>
>
> i dont know; i think using an instance of dbaccess to control a single
> instance of the
> mysqli class is appropriate.  personally, i wouldnt extend mysqli unless i
> had a good
> reason to.  i would probly only rationalize this if i wanted to override
> some of the behavior
> in a specific way, or extend it in some meaningful way (even then i might
> use composition).
> if that isnt the intention i think composition is the best choice for the
> singleton.
> more a matter of preference than anything i suppose.  at least i cant think
> of a better reason
> to argue for composition.
>
>
> > no idea what you mean
>
>
> ya; some of these posts from you are a little hard to understand, julian.
>
> -nathan
>

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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux