[TYPO3-50-general] ObjectManager and ObjectFactory

Martin Kutschker masi-no at spam-typo3.org
Thu Nov 20 09:38:09 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.

get() / getObject()
create() / createObject()


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