Issue Bug Rejected

#70873Fix inconsistency of the calling order of Container::injectDependencies() and AbstractEntity::initializeObject()

Klaus Bitto 10/20/15, 15:10 updated 03/02/16, 12:31

Description

This is born out of the discussion at https://review.typo3.org/#/c/40522/ (https://forge.typo3.org/issues/66482)

Container::getEmptyObject() calls first initializeObject(), then injectDependencies().
Container::getInstanceInternal() calls first injectDependencies(), then initializeObject().

From a software design standpoint, it would definitely make much more sense to change __wakeup() and call initializeObject() only after injectDependencies() whereever it applies. Otherwise, initializeObject() as an API construct is much less useful. Many scenarios would require e.g. an injected objectManager/configurationManager to setup the object for use. There is no other auto-called method for initializing after dependencies have become available. This seems wrong to me. :)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.