[TYPO3-project-4-3] FYI: patch for autoloader is in the BT

Martin Kutschker masi-no at spam-typo3.org
Sat Oct 25 22:10:10 CEST 2008


Dmitry Dulepov schrieb:
> Hi!
> 
> Martin Kutschker wrote:
>> t3lib_div::makeInstance uses a private static variable. Maybe you didn't
>> read the thread where we talked about singletons, but it turned out that
>> it is better (for the unit tests we may see some day) to use a storage
>> outside of the class itself (in our case t3lib_div::makeInstance).
> 
> It will not look good...

Please don't turn this into a discussion about aesthetics. Basically I
don't care if a TYPO3 singleton uses a getInstance method or not. But
this was not the way it was decoded. While there was no formal vote, the
patch introducing singletons via t3lib_div::makeInstance was accepted
(and there are reasons for it as I have written, so it's not only about
style).

If it were for style only I wouldn't insist on the change. See the
thread "RFC #9520: add a scheme to support singletons with
t3lib_div::makeInstance" (you have even posted a comment within it) in
the Core list.

I think this should at least make clear why you should not implement
t3lib_Singleton AND provide a getInstance method. It's either-or, you
cannot have them both. But really, I don't get the point why you don't
want to use the new feature.

Masi


More information about the TYPO3-project-4-3 mailing list