On 23.06.2011, at 20:22, Kris Wallsmith wrote:

> I agree that there is too much configuration when setting up a controller 
> service, but this won’t be an issue anymore once we’re able to define a 
> service and its dependencies using annotations, as everything will be in one 
> place.
> 
> /** @Service(“main_controller”) */
> class MainController
> {
>   /** @Service */
>   private $request;
> 
>   /** @Service */
>   private $router;
> 
>   /** @Service(“doctrine.odm.mongodb.document_manager”) */
>   private $dm;
> 
>   /** @Route(“/“) */
>   public function homepage()
>   {
>     // ...
>   }
> }

annotations are not the silver bullet and we should never rely on them to solve 
an issue. configuration is traditionally not separated from code because there 
were no means to have them together, but because it simply makes sense. for 
example defining your dependencies inside your code defeats the purpose if 
dependency injection even if it can be overridden because then you end up with 
a mess of false expectations.

furthermore annotations can kill development performance as they keep causing 
the config cache to trigger a refresh as you change files.

so annotations are all nice, but they cannot be our sole answer to a real world 
issue.

regards,
Lukas Kahwe Smith
m...@pooteeweet.org



-- 
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 symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to