[TYPO3-50-general] ObjectManager and ObjectFactory

Sebastian Kurfürst sebastian at typo3.org
Wed Nov 19 17:48:40 CET 2008

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.


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