Project

General

Profile

Actions

Bug #70873

closed

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

Added by Klaus Bitto about 9 years ago. Updated over 8 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-10-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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. :)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #66482: Extbase persistence layer fails to create empty objects in PHP 5.6.Closed2015-04-19

Actions
Actions

Also available in: Atom PDF