State Diagram in UML
Case Study—Courseware Management System
Because our Courseware Management System case study does not undergo any noticeable state changes, we will drill down our attention to the Course object in the system. Recall that a state diagram can be defined not only for a system or subsystem, but also for an object in the system.
Identifying states and events of the Course object
The Course object does undergo state changes during its lifecycle, right from course creation to deleting a course. Let us depict the Course object's lifecycle by using a state diagram to understand it better. The events that occur in the lifecycle of the Course object are listed below:
- Create new course—add information for the course or update an existing course; update information for the course
- Add topics—add topics to the course
- Assign tutors—assign the available tutors for the course
- Close—finished adding or updating the course
This event kicks off two events that change the state of the Course object, but are part of the new course event. These two events contained within the new course creation event are adding topics to the Course object and assigning tutors for the course. This results in the Topic objects getting associated with the Course object. Next, the course administrator may wish to assign tutors to teach the course by identifying the tutors that teach this course (based on their specialty/preferences) and checking the availability of the tutors for a given period of time.
This completes the lifecycle Course object until the time an update course event occurs.
Figure 6.3 shows the state diagram for the Course object. The state diagram depicts the changes in the state of the Course object as it transitions through the various events in its lifecycle.
Figure 6.3: the state diagram of the Course object
This article covered the first of the series of dynamic diagrams in UML. The state diagram is one of the simplest ways to represent the lifecycle of an entire system or a subsystem or even an object of a system. In the next article of this series, we will learn about Activity diagrams.
About the Authors
Mandar S. Chitnis, Lakshmi Ananthamurthy, and Pravin S. Tiwari are the co-founders of Novusware, Inc. They have co-authored the book Sans Teach Yourself BEA WebLogic Server 7.0 in 21 Days (SAMS Publishing, Oct 2002) based on the recently launched WebLogic Server 7.0 by BEA Systems, Inc.
For any questions or queries regarding the article contents, please contact firstname.lastname@example.org.
Page 2 of 2