On of the quick and porting application we are doing, we used forms approach to quickly build the app.
However, one issue we see if a screen has more than one option says Login, Register as options, user is able to quickly choose login and before the screen changes to login form, the user could again choose register.
Is there a good way to avoid showing of other options, when one of the option is in the progress state.. due to low power of CPU's transition is taking some time..
Hope some one must have faced such issue may have some good solution to the same..
As you suggest, the way is to use a strict event/state model for your code, and to exit the previous state completely before entering the next one.
In a situation where entering a state is a lengthy process, then what you really have is an additional state. The events that exit this state might be "success" (causes transition to next state) and "fail" (causes return to previous state). The objective is, never to have a state transtition that takes any significant time.