October 21, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

State Diagram in UML

  • July 21, 2003
  • By Mandar Chitnis, Pravin Tiwari, & Lakshmi Ananthamurthy
  • Send Email »
  • More Articles »

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

Consider the event of adding a new course to the Courseware Management System by the course administrator. The course administrator fills in the course information, thus initiating the creation of the Course object.

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.



Click here for a larger image.

Figure 6.3: the state diagram of the Course object

Summary

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 articlewriters@novusware.com.





Page 2 of 2



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Sitemap | Contact Us

Rocket Fuel