Copyright © 1998 Sita Ramakrishnan, Monash University All rights reserved

Light Views

HomeCase StudiesOO TheoryHelp

Beaches and Parking Case Study

State Chart Diagram (UML model)

 

Demonstration: An animated State Chart Diagram

The state chart diagram is a UML model. This shows when and under what condition an object in question moves from one state to another. This state transition is caused by an event, whether it is a user generated events or system generated events.

The purpose of this UML diagram is to give user a better picture of what is really happening inside the applets, that is how events are handled and what effect does it have on the object. After all this is all about event testing.

The state diagram below uses notations that are not in-defined in standard UML notation. The reason is because UML is a modeling language that is independent of any language specific features. For example, in the case study, to identify applet communication dotted lines are used. The following is an example of the state chart diagram.

Sample UML diagram

The round rectangular represents a state. A state represents a condition of  the object at that stage, it may be in the process of completing a task. In the left figure, Painting means that the object is drawing its contents onto the screen.

 

The arrow represents an event that causes the state transition to take place. In the example here, the object moves from Painting state to Ready state when the screen has been updated.

The dashed line represents concurrency which simply means that the states from both side of the lines may run concurrently. This demonstrates what is happening when the applets are loaded and initialiased. The four applets are loaded, most probably their init() methods are called roughly at the same time which means all of them go into Initializing state at the same time as will be shown in the animation.

 


Funded by Committee of University Teaching And Staff Development (CUTSD) through DEETYA, 1998