[ Team LiB ] Previous Section Next Section

Activity States

In the states I've described so far, the object is quiet and waiting for the next event before it does something. However, you can have states in which the object is doing some ongoing work.

The Searching state in Figure 10.3 is such an activity state: The ongoing activity is marked with the do/; hence the term do-activity. Once the search is completed, any transitions without an activity, such as the one to display new hardware, are taken. If the cancel event occurs during the activity, the do-activity is unceremoniously halted, and we go back to the Update Hardware Window state.

Figure 10.3. A state with an activity

graphics/10fig03.gif

Both do-activities and regular activities represent carrying out some behavior. The critical difference between the two is that regular activities occur "instantaneously" and cannot be interrupted by regular events, while do-activities can take finite time and can be interrupted, as in Figure 10.3. Instantaneous will mean different things for different system; for hard real-time systems, it might be a few machine instructions, but for desktop software might be several seconds.

UML 1 used the term action for regular activities and used activity only for do-activities.

    [ Team LiB ] Previous Section Next Section