On 21.03.2010, at 11:45, Marijn <[email protected]> wrote:

Hi everybody,

My personal favorite is injecting the required services in the
constructor and use one class per action. This has several benefits:

* We don't need to create some kind of convention about routing
arguments overruling service arguments
* Our controllers can be easily tested
* Our controllers are thin
* We can still use inheritance to leverage a base controller that
shares the common methods among the concrete action implementations
* We can implement this without to much new code
* We don't load heavy controller classes while only using one mehod
( yes, Fabien I know, one shouldn't have any heavy controllers;) )

Personally I don't see why we should try to make this problem more
complicated than it is.
By using a one class per controller approach we can have this
implemented in no time without any new magic.

that does solve the issue at hand. for smaller projects this might be the best approach even especially if you follow the fat model approach. but for larger projects i think this will become a bit painful to manage.

this however is another argument for the constructor way along with some solution to deal with heavy optional dependencies.

I also would like to add my vote to Bernards statement about array
access and __magic__ properties, please don't:)

on top of that "__" is sort of reserved for php internal magic.

regards
Lukas

--
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.

Reply via email to