Re: Code Critique Please :)

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

 



On Thu, 2007-11-22 at 12:46 -0500, Oscar Gosdinski wrote:
>
> There is something that i always wonder about Singleton pattern in
> PHP, do you really have a benefit using this pattern in PHP? The idea
> behind this pattern is that only one instance of the class is created,
> it works great in Java because all requests are processed inside a JVM
> and this instance created will really be the only one defined. Because
> in PHP every request has its own environment, you will have several
> instances of this class per request processed.

Doesn't matter... you may have multiple requests for the object within
the same HTTP request. Singleton pattern is very valid in PHP.

Cheers,
Rob.
-- 
...........................................................
SwarmBuy.com - http://www.swarmbuy.com

    Leveraging the buying power of the masses!
...........................................................

-- 
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