Labels

Tuesday, May 14, 2013

Addition of StateChart to Blackboard

The StateChart pattern, from a paper by Yacoub and Ammar entitled "A Pattern Language of StateCharts," is coming along nicely.  I have the classes together and most of the code is in place, although there are some interesting issues when creating the C++ code with Bouml - not a problem with the program, just a problem with my understanding of configuring it to generate C++ the way that I want.  The class diagram is as follows:



Notice that I have incorporated the CommandProcessor as part of the actions.  The way that this works is to have the state interface control the way that the states are manipulated.  The events are enumerations (to keep it simple and to be able to cause an event to happen remotely).  The actions that are executed when a given state is entered, use the CommandProcessor to separate the commands from the overall logic of the state and at the same time provide a "named" execution.  The other nice thing about this design pattern, is the ability to create new states and actions on the fly (e.g., from the Control knowledge sources) to manipulate how the system reacts in a given instance.  Although that is a nice ability, the StateChart design pattern does allow for orthagonal state charts which are independent from each other, but can be executed in parallel.  How to eventually implement this is a TBD at this point.