Hi Bernhard.

I'm not sure I follow. With both GetResponseEvent and PostResponseEvent, I can retrieve the request/response objects. Because of the way objects pass in PHP, both are mutable in practice.

When I say "info" hooks/events, I don't mean notification events. I mean "tell me about yourself" data-collection events. For the specific case at hand, it would be asking all modules to return a RouteCollection (or in other cases an array of objects, or array of arrays), and then deliberately allowing other modules to modify that RouteCollection rather than passing an event that implicitly allows the collection to be modified by virtue of PHP's object passing semantics.

It's certainly possible that I'm over thinking this, but I know I'm going to be asked to establish an easy pattern (because Drupal is like that), so I want to make sure it's a Symfony-friendly pattern.

--Larry Garfield

On 11/7/12 5:16 AM, Bernhard Schussek wrote:
Hi Larry,

Currently, Symfony distinguishes between these sorts of events as you
said, by providing mutable or immutable event objects. If an event
object is immutable, the event is clearly an "info" event. If the event
object is mutable, it would be an "alter" event.

For example, GetResponseEvent [1] in HttpKernel is an "alter" event,
while PostResponseEvent [2] is an "info" event.

I don't think you need a more sophisticated pattern than that.

Cheers,
Bernhard

[1]
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Event/GetResponseEvent.php
[2]
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php

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

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