[TYPO3-mvc] Question about DI and current component wiring method

Xavier Perseguers typo3 at perseguers.ch
Wed Aug 5 12:07:42 CEST 2009


Hi Bastian,

>> A question arised in my head this morning regarding Dependency 
>> Injection and I could not find an answer... I understand it and is 
>> described as a way to prevent having explicit dependency on other 
>> classes.
> 
> Actually it's pretty simple: Instead of instantiating objects within 
> your code, you pass them into your object in the constructor or in a 
> special setter.

Yes, I know how I may do this in v4. It's just that I remember a while 
ago a direct dependency in Extbase that I wished I could have taken away 
and this was not possible to give it any other already-instantiated 
object instead.

Thanks anyway for the code you wrote. It will always be useful to have 
it at hand.

-- 
Xavier Perseguers
MVC ExtJS Leader

http://forge.typo3.org/projects/show/extension-mvc_extjs


More information about the TYPO3-project-typo3v4mvc mailing list