[TYPO3-mvc] [TYPO3-dev] URGENT CHANGE REQUEST: Dependency Injection Problems with ExtBase 1.3.0RC1

Sebastian Kurfürst sebastian at typo3.org
Mon Jan 24 11:25:31 CET 2011


Hi Daniel,

> Is there a reason, why the ExtBase DI is triggered by the methodName and not
> explicitly by an annotation like "@inject"? A negative annotation like
> "@doNotUseExtbaseDI" could be implemented with a single line in
> classInfoFactory::getInjectMethods... With annotations we can use extbase-DI
> where it is possible and our custom DI where it is not.
Yeah, because in FLOW3, it also happens automatically if you follow the
inject* method name conventions. That's why I won't change this for
Extbase either.

> In the extension Michael talked about, we use factory classes to build our
> objects. This is not supported by extbase-DI, which (if i read the code
> correctly) just instantiate an object by t3lib_div::makeInstance(). I just
> thought about a TS configuration option for that (forge wiki example):
+1, a patch on this is welcome :)

> What about the feature to define the class names on a per-extension basis as
> mentioned in the wiki? Are there plans to do that in the near future? 
Unfortunately, this is a really difficult one, because of multiple
reasons, which have to do with singletons:
- As singletons are *request-global* and not *plugin-global*, two
plugins right now use *one singleton*. Thus, one could not re-wire the
DI in between extensions; as one would need to throw away certain
singletons and re-instanciate them.

- Furthermore, there are certain classes early in the bootstrap (mainly
the Configuration* subpackage) which cannot be replaced by DI, as the
configuration is not loaded yet at this point.

Greets,
Sebastian


More information about the TYPO3-project-typo3v4mvc mailing list