[TYPO3-core] RFC #9505: Make the caches in TYPO3 use the new caching framework
Martin Kutschker
masi-no at spam-typo3.org
Wed Oct 8 09:08:49 CEST 2008
Ingo Renner schrieb:
> Martin Kutschker wrote:
>
>> Even if $cacheManager may be used in theory in a wider context, it's a
>> TYPO3 variable.
>
> Do you mean it should be renamed $typo3CacheManager ?
Something like that. But there is no real naming scheme for TYPO3 globals :(
>> I know that the 5.0 team doesn't like singletons but I would
>> appreciate if we could avoid new globals if possible. Actually I have
>> no idea if there must be only one copy of the cache manager around, so
>> maybe I'm on a wrong track here.
>
> at least only one is needed, so I'd be fine with a singleton, too. But
> to achieve this t3lib_div::makeInstance() must be made aware of singletons.
> How about a simple check whether the class has a method named
> getInstance(), if that is the case it is used instead of the new operator?
I suggested this once, but Robert told me that singletons are bad when
it comes to unit tests. I don't know, but maybe it helps (for unit
tests) if t3lib_div::makeInstance() would test if the class implements a
certain (fake) interface or has a certain doc comment set and stores a
reference to the object in a static variable.
Masi
More information about the TYPO3-team-core
mailing list