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

Jochen Rau jochen.rau at typoplanet.de
Fri Jan 15 13:55:54 CET 2010


Hi,

On 15.01.10 08:09, Sebastian Kurfürst wrote:
>> 3. Is the @inject annotation supported? In the blog example,
>> t3lib_div::makeInstance() is used for accessing the repositories in the
>> controllers. Does it really create a new instance of a repository each
>> time? If @inject is supported already, should it replace the
>> t3lib_div::makeInstance function?
> No, it is not supported right now, as dependency injection is not yet
> supported.

But it is on our wish-list for Extbase 2.0. That's part of a bigger 
scope: Object Lifecycle.

The class Tx_Extbase_Persistence_Repository implements t3lib_Singleton. 
This is a marker for t3lib_div::makeInstance() to make/deliver a 
singleton. If you say "new Tx_..._FooRepository()" you always get an 
empty Repository and nothing gets persisted.

@inject in combination with @singleton will lead to the same result in 
the future version of Extbase (IMHO).

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list