[TYPO3-mvc] questions: @lazy, @inject, @api, constructors

Martin Kutschker masi-no at spam-typo3.org
Fri Jan 15 11:47:44 CET 2010


Franz Koch schrieb:
> Hi,
> 
>>> 4. Is there a guideline/good practice rule which defines which fields of
>>> a class should be initialized in its constructor?
>> - definitely all ObjectStorages (Tx_Extbase_Persistence_ObjectStorage)
> 
> I wonder why I have to define all ObjectStorages in the constructor when
> the constructor is never called from inside extbase. Non automatically
> persisted/injected objects get built calling the constructor. I noticed
> this when I actually defined a ObjectStorage in the constructor and
> tried to used it in a getter/setter method.

If I understand correctly a reconstitution from DB will (read: "should") create the ObjectStorages
automatically.

Masi


More information about the TYPO3-project-typo3v4mvc mailing list