[TYPO3-50-general] ObjectManager and ObjectFactory

Malte Jansen mail at maltejansen.de
Wed Nov 19 21:31:48 CET 2008


Sebastian Kurfürst schrieb:
> Hi Malte,
>>
>> F3::FLOW3::Object::Manager::getObject(...)
>> F3::FLOW3::Object::Factory::create(...)
>>
>>
>> Wouldn't it be better, if they have the same naming?
>> E.G. You alredy have the factory injected into a class. Later, you need
>> a singleton-object. So you have to update much more (the function name).
>> It can be done via a replace-function, but it is still a little bit more
>> work.
> AFAIK this has been done intentionally.
> In case you need a singleton, the normal way should be Dependency 
> Injection. For prototypes, use the ObjectFactory
> 
> getObject() should be only used in really really rare cases - as in many 
> other cases, you could easily do it via the above ways.
> 
Ok, I have checked the Documentation. I should always do after big changes.

So, all classes should be checked for there scope, because creating
   F3::FLOW3::Reflection::MethodReflection
with ObjectFactory is not possible and you might have more than one 
ReflectionMethod-Object at the same time...

Cheers,

Malte


More information about the TYPO3-project-5_0-general mailing list