note 59273 deleted from language.oop5.patterns by felipe
| From: | felipe@php.net | Date: | Sat, 15 Dec 2007 01:45:07 +0000 |
| Subject: | note 59273 deleted from language.oop5.patterns by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133509@lists.php.net to get a copy of this message | ||
Note Submitter: aya at eh dot org
----
Personally I find the aforementioned 'singleton pattern' pointless in many cases, since a
class containing only static members and functions is already a 'singleton'. The code in
'Example 19-25' above could simply read:
<?php
class Example
{
// Example method
public static function bark()
{
echo 'Woof!';
}
}
// Call 'singleton' method
Example::bark();
?>