Return to Website   
Quantum Leaps Discussion Forum

Search the Forum for answers or post your questions to the
Quantum Leaps community



Return to Website

  Reply
  Forum

Subject:   Re: event handling question
Name:   Tad Ashlock
Date Posted:   Jul 11, 08 - 5:58 AM
Email:   taashlo@cyberdude.com
Message:   I'm not sure how proper my suggestion is, but you could handle the sub-state-specific stuff in the respective sub-state event handlers, but instead of having them return 0 (indicating that the event was handled), have them return the pointer to the super-state event handler. (This indicates to the QF that the event has not been [fully] handled.) Then put the common stuff in the event handler of the super state under the same event as in the sub-states.

I don't know how you would diagram this with a statechart, but with sufficient commenting (in the code and on the statechart), I think it wouldn't be too confusing to a maintainer.

This may be one of those things that isn't allowed in UML, but can be done with the Quantum Framework and is safe and has some advantages. Like a hierarchical state machine being in a composite state. Not allowed in UML, but very handy and safe to do.

Tad
Replies:    
Re: event handling question by Miro Samek · Jul 14, 08 - 9:29 AM
Re: event handling question by mikec · Jul 14, 08 - 11:53 AM
Re: event handling question by Miro Samek · Jul 14, 08 - 12:12 PM


  Reply
  Forum


powered by Powered by Bravenet bravenet.com