Posted by Ivαn Sαnchez Ortega on 07/25/07 20:07
Sanders Kaufman wrote:
> Since PHP4 (and apparently 5, as well) doesn't make the constructor a
> private function, I don't yet see any reason to NOT use it as a
> reset-switch for my object; to return it to a pristine state.
Declaring the constructor as private prevents the programmer from
instantiating the class outside the class scope. Go read the Singleton
pattern.
--
----------------------------------
IvΓ‘n SΓ‘nchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
http://acm.asoc.fi.upm.es/~mr/ ; http://acm.asoc.fi.upm.es/~ivan/
MSN:i_eat_s_p_a_m_for_breakfast@hotmail.com
Jabber:ivansanchez@jabber.org ; ivansanchez@kdetalk.net
Navigation:
[Reply to this message]
|