Object Diagrams in UML, Page 3
Case Study: Courseware Management System
Now, we shall create an object diagram for the courseware system. To do this, we will first build up on our class diagram, and include the possible attributes and define the parameters of to the classes defined earlier.
We will follow the following convention for the variable names:
Names starting with "s_" are of the String data type
Names starting with "i_" are of the int data type
Names starting with "v_" are of the Vector data type
The following table outlines the attributes, methods, and their return types for each of the classes:
Boolean assignCourseToTutor(s_courseId, s_tutorId)
To follow a logical sequence now, let us consider that the course administrator, courses, tutors, and topics already exist. Let us now make an object diagram for the case where the administrator with user id "admin" wishes to access the course calendar of a course with course id "Math_Course_001."
Hence, the following will be the attribute values, and method calls:
CourseAdministratorAttributes: s_adminId = admin s_courseId = Math_Course_001Methods: viewCourseCalendar("Math_Course_001")
This method will call the method viewCourseInfo of class Course, which returns a Vector object populated with all the details of the course "MathCourse_001" (see Figure 5.8)
Figure 5.8—the object diagram for the courseware management system, for a simple scenario of the course administrator managing a math course.
In Figure 5.8, for the single case where the flow is from Course Administrator to Course, when the CourseAdministrator is requesting the course information for a particular course.
In the last article, we saw how to make class diagrams, and made a class diagram for the case study—the Courseware Management system. In this article, we saw:
- What an object diagram is
- Notation used in an object diagram
- What the significance and use of an object diagram is
- How to make an object diagram in Poseidon
- The object diagram for a simple scenario in our Courseware Management system
In the next article of this series, we will study the state diagram.
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 Teach Yourself BEA WebLogic Server 7.0 in 21 Days (SAMS Publishing October, 2002) based on the recently launched WebLogic Server 7.0 by BEA Systems inc.
For any questions or queries regarding the article's contents, please contact email@example.com.