Please don't use term "premature optimization" here

"Premature optimization" is a phrase used to describe a situation where a
programmer lets performance considerations affect the design of a piece of
code. This can result in a design that is not as clean as it could have been
or code that is incorrect, because the code is complicated by the
optimization and the programmer is distracted by optimizing.


I don't see any "performance considerations" that would have caused it to be
this way.

I think a proper fix would be to remove Request from service container,
letting users only get ahold of it in an event listener, which is not
request instance bound. And also document this as the recommended way of
operating on Request.

On Tue, Feb 22, 2011 at 2:44 PM, Lukas Kahwe Smith <[email protected]>wrote:

>
> On 21.02.2011, at 09:19, Bernhard Schussek wrote:
>
> >> * The default PHP paradigm is to have only one global scope, so people
> will
> >> expect that their object stay the same whatever request/sub-request they
> are
> >> in.
> >
> > Isn't this expectation wrong? If people assume it is legit to
> > transport state from a master request to a sub request using a shared
> > service, they will have problems as soon they turn on caching (i.e.
>
> well if someone intentionally carries over state from one request to
> another then he deserves to get shot.
>
> > separate master requests). What's worse, these problems might not be
> > apparent right away.
>
> that is more the issue i am concerned about. some people might accidentally
> make their service stateful and get burned in the process. so to be
> defaulting to container scope is premature optimization for most developers.
> think its better to be conservative here. obviously once they become more
> advanced they will learn about scope and then set the scope explicitly to
> the correct type.
>
> 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
>



-- 
*Bulat Shakirzyanov* | Software Alchemist

*a: *about.me/avalanche123
*e:* [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