On 22.03.2010, at 08:55, Fabien Potencier wrote: > On 3/22/10 1:28 AM, alberto wrote: >> >> If you really need an expensive-to-create service which is only needed >> for not all of your actions, and it really belongs there, (like the >> mailing service you are discussing) then I think it should be lazy >> loaded. If you want to relieve the users from having to take care of >> that, maybe something at the container level could be implemented to >> be able to indicate that when wiring the service. I think it could be >> done via dynamic proxies (in the same way Doctrine does, if I am not >> mistaken). > > The DIC already lazy-load the services. They are only created on demand when > you need them. But if a method needs a service as an argument, of course we > need to create it right away.
i think he was suggesting using proxy classes for the dependencies of the dependencies in order to keep the maximum cost of making a dependency instance as low as possible. but i dont think this is a really good approach. the proxy classes will need access to the service container as well, so you might as well give the access to the action class, which i still believe to be a bad idea. regards, Lukas Kahwe Smith [email protected] -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en To unsubscribe from this group, send email to symfony-devs+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
