note 89213 deleted from language.oop5.patterns by danbrown
| From: | danbrown@php.net | Date: | Sat, 28 Feb 2009 17:08:39 +0000 |
| Subject: | note 89213 deleted from language.oop5.patterns by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151252@lists.php.net to get a copy of this message | ||
Note Submitter: geoffrey at emmans dot de
----
vaddsm: that's a nice try if you always use fSingleton to create either fClassOne or fClassTwo.
But half a year later, somebody else on your team will look at your code half-heartedly and do a
$obj = new fClassOne();
There's nothing that will stop him from doing that. Your solution may be nice to ensure lazy
loading, but only (final) private/protected contructors and clone-methods will make it impossible to
create a second instance of your class.