We currently dispatch some object events to sublocations. I think
there's a problem with the current approach.

If I subscribe to IObjectModifiedEvent with something like this:

  def handle(object, event):
       ...

I'll get notifications where object and event.object are different. This
happens for sublocation dispatches. This was very surprising, but it
makes sense -- there are cases when you'd want to get notifications like
that.

But most of my code looks like this:

  def handle(object, event):
      # ignore Zope's sublocation dispatches
      if object != event.object:
          return
      ...

I propose that we dispatch using both the original object and the
sublocation, along with the event. Handlers for these sublocation
dispatches would then look like this:

  def handle(object, sublocation, event):
      ...

 -- Garrett
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to