note 78050 deleted from language.oop5.patterns by danbrown
| From: | danbrown@php.net | Date: | Sun, 23 Jan 2011 16:42:14 +0000 |
| Subject: | note 78050 deleted from language.oop5.patterns by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176110@lists.php.net to get a copy of this message | ||
Note Submitter: me at chrisstockton dot org
----
For anyone who reads: anonymous at world4ch dot org
Please do not confuse the singleton for a global variable, they are nothing the same. The global
keyword is a way to extract a variable from the global scope into your local scope. A singleton is a
way to control class instantiation, independent of scope to a single instance.
In addition note the importance in design patterns, the ability to interchange interfaces and
abstraction to allow easy adaption to a variety of needs and specifications through a single means
of access is invaluable to many large scale enterprise applications. Specially pay-for software that
has many system architectures to accommodate. However, the comment makes a good point to implement
as necessary, the many principles don't apply to every problem domain. Do not conform your
problem to a pattern, implement a pattern to your problem.