[FLOW3-general] DependencyInjection: Best practice
Julian Kleinhans
typo3 at kj187.de
Thu Jan 7 21:42:42 CET 2010
Hi Robert,
fantastic! Thanks for your advice!
cheers
julian
Am 06.01.10 13:11, schrieb Robert Lemke:
> Hi Julian,
>
> Am 02.01.2010 um 16:10 schrieb Julian Kleinhans:
>
>> What is different between 2 and 3? What is the best way ?
>> The property injection needs no method and is really short.. so i would say, use property injection instead setter injection.. or is there any special reason
>
> Although there is a little perfomance gain when using 2), it is much more convenient to use 3). However, 2) is more portable than 3) because 3) really relies on the framework to know about @inject annotations.
>
> I recommend that you use 3) in all of your applications if the portability aspect is not important in your case. I must admit though that we have the policy to use only setter injection in FLOW3 itself due to speed reasons and some other implications.
>
> We plan to speed up the use of property injection (and after all it's not that slow even currently) and from my experience it's no real big deal to create an accessible proxies in my unit tests.
>
> So after all its a matter of taste ...
>
> Cheers,
> robert
>
>
--
Julian Kleinhans
Certified TYPO3 Integrator
email: typo3 at kj187.de
web: http://www.typo3-tutorials.org
Xing: http://www.xing.com/profile/Julian_Kleinhans
Twitter: http://twitter.com/kj187
More information about the FLOW3-general
mailing list