[IGSTK-Developers] Comments/Suggestions appreciated.

ranjan ranjan at isis.imac.georgetown.edu
Mon Feb 14 15:31:22 EST 2005


Dear all.



The state-machine integration in the "tracker" and "communication" 
classes in my implementation weren't correct. It is because the 
actions taken by state machine are as follows:

a. change the state as per the transition defined for the input.
b. call the action method required for this transition.

In my classes, the action method may or may not succeed. So I needed 
a way to 

a. record result of an action performed.
b. revert back the state if the action wasn't successful.

The way I am implementing this is as follows:

a. I have created "transient" states in which the actions are 
   performed.
b. I have created "inputs" representing "success" or "failure" of the 
   action performed.
c. I have created result "input" pointers, and in the action method, 
   I assign this pointer to either "success" or "failure", depending 
   on the result.
d. From the "transient" state, this result pointer is processed.


I had thought of various other ways, but finally converged to this 
approach. Your comments/suggestions are solicited.


Sohan
 





More information about the IGSTK-Developers mailing list