> Part of the small details that are being brought up are from trying to
> establish best practices for the framework and bundles.  Having a few
> details established will make it easier to move from app to app and from
> bundle to bundle.  

Don't get me wrong, these are all noble goals and I do not object to
any of them. What I'm simply questioning is if this specific detail is
so important that it must be evaluated with such scrutiny. There have
been threads for this on this mailing list and on GitHub, and the pros/
cons haven't changed much, so haven't the people discussing it.

I believe there is already a best practice (using $this->container-
>get()), and what we are discussing is simply how beginners should be
getting to know the container (via ArrayAccess, or via a method call -
>getService()). This, so it seems to me, is mostly a matter of
personal taste/background. That's why we could probably argue
endlessly what's best and getting nowhere :). Besides, to us it
doesn't really matter anyway since we will be using the best practice
for the very reasons you mentioned above.

Johannes


> If my memory is correct, there are 4 different ways
> to do access the service in controller.  IMHO, consistency in the
> details will make it easier for beginners (by that I mean new to SF2) to
> use the framework and reuse and contribute to bundles.  So in that
> sense, I believe it does matter.
>
> Richard
>
> On 11/01/2010 03:32 PM, Johannes wrote:
>
> > No offense, but I find it quite amusing how often this small detail is
> > brought up. I think there are far more important things than whether
> > beginners access the container via ArrayAccess or via a direct method
> > call. After all, we are no beginners so how can we know what they like
> > most? And for everyone aware what this actually does, it doesn't
> > really matter anyway.
>
> > I'm totally indifferent on this +/- 0  :)
>
> > On Nov 1, 10:43 pm, Nicolas A. B rard-Nault<[email protected]>  wrote:
>
> >> On Mon, Nov 1, 2010 at 9:11 AM, Benjamin Eberlei<[email protected]>wrote:
>
> >>> Hello,
>
> >>> I just stumbled over this again in the docs and in some code, i think
> >>> the notation $this['servicename'] inside controllers is confusing. I
> >>> know its probably there to simplify beginners exposure to the DI
> >>> Container, however the notation looks very strange and i have never seen
> >>> that usage of ArrayAccess before. I am not sure its very helpful to
> >>> beginners.
>
> >>> Wouldn't a simple method "getService($name)" inside the controller be
> >>> much more explicit and understandable from anyones perspective?
>
> >>> I dutifully and wholeheartedly agree with you Benjamin. +1 for
>
> >> getService().
>
> >>> greetings,
> >>> Benjamin
>
> >>> --
> >>> 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]<symfony-devs%[email protected]>
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/symfony-devs?hl=en
>
> >> --
> >> Nicolas A. B rard-Nault ([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

Reply via email to