[TYPO3-mvc] How to get to typoscipt ?
Franz Koch
typo3.RemoveForMessage at elements-net.de
Sat Jan 15 14:39:25 CET 2011
Hey Claus,
> I tried to use an inject method inside a validator class. This is a
> controller argument validator.
> The inject method will not triggered. I think cause of the validator
> instance is not create by the objectManager, isn't it ?
if it's not working I'd say it's probably a bug and we missed that spot
when making use of the objectManager - but I'll have to check that.
> There is another thing about DI I ask myself.
> I'm using daily DI with Java (JBoss Seam) and I'm not sure if this
> almost the same as Extbase DI.
>
> e.g.
> @In(create=true)
> private userServiceInterface userService;
>
> You can use this everywhere and don't care about how the instance is
> created. Of course the lifecycle do the job everywhere.
I haven't dug to deep in the DI implementation of extbase yet, I only
know that there is currently only limited support for lifecycle methods
and IIRC it's not planned to add those - but they are available in
FLOW3. The only method getting triggered I know of is "initializeObject"
(if available in the object of course).
> Another nice thing is, I can inject objects from session (or any other
> ScopeType).
> e.g.
> @In(create=true, scopeType=ScopeType.SESSION)
> private userBeanInterface user;
>
> If the user object already exist I will get this otherwise I get a new
> instance. This is very nice to handle existing objects in your controller.
>
> Are things like that possible in Extbase ?
Well, if the objects that should be injected are singletons (implement
t3lib_Singleton), you of course will get the very same instance
everywhere, but scopes are AFAIK not supported in extbase (but in FLOW3
IIRC).
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list