Re: Traits and static methods
| From: | Simas Toleikis | Date: | Wed, 17 Nov 2010 06:40:42 +0000 |
| Subject: | Re: Traits and static methods | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50287@lists.php.net to get a copy of this message | ||
Hi Ferenc,
for reusable singleton pattern with php 5.3
> http://www.slideshare.net/fabpot/design-patternrevisitedphp53
> slide 11 and 12
>
As Tom already pointed out - there is that lock-down of your parent(s) to
singletons with this type of implementation and there are other shortcomings
when used with SPL, for example:
class Test extends ArrayObject { }
Without creating some sort of intermediate ArrayObjectSingleton class you
can't make Test a singleton (and traits would solve that).
/Simas