RE: [PHP] OO parent/child relationship

From: Date: Mon, 06 Oct 2003 17:14:01 +0000
Subject: RE: [PHP] OO parent/child relationship
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-165210@lists.php.net to get a copy of this message
This all seems like a perfect case for the singleton pattern. See http://www.phppatterns.com/index.php/article/articleview/6/1/1/ and http://www.phppatterns.com/index.php/article/articleview/75/1/1/ Andy > -----Original Message----- > From: Evan Nemerson [mailto:evan@coeus-group.com] > Sent: Monday, October 06, 2003 2:07 AM > To: Robert Cummings; Curt Zirzow > Cc: PHP List > Subject: Re: [PHP] OO parent/child relationship > > Aye. PHP already reserves function names prepended with __ as magic. But > really one could make this argument ad infinitum. If everyone wants to > start > their variables with a *insert random character here*, "*grin*" > > IMHO it's good advice to "prepend global vars with '__' or something". I > usually prepend my global vars with the application name. For instance, > $wiki_DSN, $wiki_title, $wiki_authors, etc. > > > > On Sunday 05 October 2003 09:58 pm, Robert Cummings wrote: > > On Mon, 2003-10-06 at 00:48, Curt Zirzow wrote: > > > On the global topic, I would suggest establishing a standard > > > naming convention for your common globals that are used, I do > > > something like: > > > $__object_something__; > > > > > > With your global var I can see myself writing something that will > > > overwrite that $class_ref, Like say if I'm handling something that > > > has to do with referee's in school classes :) Preceeding the > > > global vars with '__' or something will keep the namespace clashing > > > cases down to a minimum. > > > > But if everyone fallows your advice for using __ as a prefix... *grin*. > > > > Rob. > > -- > Evan Nemerson > evan@coeus-group.com > > -- > "To achieve adjustment and sanity and the conditions that follow from > them, we > must study the structural characteristics of this world first and, then > only, > build languages of similar structure, instead of habitually ascribing to > the > world the primitive structure of our language." > > -Alfred Korzybski > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#165210) next »