note 80151 deleted from language.oop5.patterns by danbrown
| From: | danbrown@php.net | Date: | Sun, 23 Jan 2011 16:42:08 +0000 |
| Subject: | note 80151 deleted from language.oop5.patterns by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176109@lists.php.net to get a copy of this message | ||
Note Submitter: tims57 at yahoo dot com
----
For anyone who reads: me at chrisstockton dot org
The note being refered to by that post is actually correct. A singleton provides essentially the
same functionality as a global variable refering to an object combined with code to create the
object at first use or application initialization. Using them is just a much more involved and
difficult to follow technique involving class instantiation. Although perhaps appropriate in some
circumstances, for many uses the global variable approach makes more sense.
The note being refered to is also correct regarding design patterns. Using design patterns and using
interfaces should not be confused, they are nothing the same. Authors of 'pay-for
software' (those 'large scale enterprise applications') have to get our laughs some
way or another!
One final point neither note writer seems to get. PHP 5 accommodates many architectures, and is
quite valuable for building scalable applications, even though it is still (thank God) free. PHP is
now one of the 'big guys', and it needs these object oriented capabilities, even though
they might be confusing to some.