Changing order of event processing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I raise an event in an ancestor, the event fires first in the ancestor,
then its descendant, and then in the descendant's descendant.

I would like the descendant's descendant to fire first in one particular
case. How do I accomplish this?
 
Events are fired in the order they are added to the event but they should be
treated as if they are non-deterministic as they very well could be issued
concurrently on multiple threads.

Cheers,

Greg
 
This is an unpleasant surprise. In the OO PowerBuilder environment I have
been working in, the ancestor event fires first, and then each descendant, in
order. If your logic requires that you fire a descendant first, you
Override the event in the descendant, and then call the ancestor events if
you want them to process after the the descendant event.

This is a key capability because it allows you to stack layers of logic to
fire predictably. For instance, during a save event, you may want the
ancestor to run general save logic, followed by some specific post-save
process in the descendant. In another case you may want a specific pre-save
process to run before the generic save logic.

Can anyone confirm that there really is no way to do this in VB 2005? If
not, what is the workaround?
 
As I said the "work around" would be to put them in the right order but this
does not assure you of anything .. The issue is that the events may be run
concurrently on different threads.

Cheers,

Greg
 
Back
Top