[TYPO3-mvc] How to get to typoscipt ?

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Jan 13 17:53:04 CET 2011


Hey Tim,

>> This is what we suggest, you should NOT use static classes, now that we have DI :)
>
>
> I haven't looked at the DI Feature yet, maybe now would be a good time to do so ;)
> But wthen - what are Utility Classes for, when not such generic tasks?

you can still have and use utility classes - we all do I think. It's 
recommended to instantiate them (having them as singleton) in order to 
take advantage of DI etc., but you can still use static classes. But 
because of the fact that almost every extbase core class depends on DI, 
you at least need to instantiate all classes in your static class using 
the objectManager which you itself can instantiate using t3lib_div.

But believe me - once you got infected by the DI virus, you gladly take 
the "overhead" to create local instances of your classes :) It's so much 
more convenient :)

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list