Hi,
I share Lukas' concerns about approach 3. It is the most magical, and
will lead to messy action function signatures and possible name
conflicts that not only need to be resolved by the framework, but also
by developers.
Personally, I would still go with option 1. Its just a small matter of
taste. I feel that as somebody who wants to construct an action from
somewhere, I (as code) need to do too much. In approach 1 I could just
toss in the container.
Also all proposals beside 1 have the problem discussed earlier about
matching names (variable against service)
In approach 1 you can do container->getUserService()
Its much easier to refactor than to search for $userService in actions.
But because 2 is compatible with 1, I have no feelings against 2 :)
I want to avoid code that looks like that:
public function editPostAction($id, $title, $year, $month, $day,
Service $Service_Pingbackservice, Service $Service_SSOService, Service
$Service_mailer){
//.. ugly stuff ...
}
public function previewPostAction($id, $title, $year, $month, $day,
$locale, Service $Service_SSO, Service $Service_RSSBuilder){
//.. ugly stuff ...
}
Especially if you have more than one action using a service you have
almost saved the lines of code trade off caused by boilerplate code.
Fabian
--
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.