State, Behavior, and Identity

I l @ ve RuBoard

The state of an object is one of the possible conditions in which it may exist. The state of an object typically changes over time, and is defined by a set of properties (called attributes), with the values of the properties, plus the relationships the object may have with other objects. For example, a course offering object in the registration system may be in one of two states: open and closed . If the number of students registered for a course offering is less than 10, the state of the course offering is open. When the tenth student registers for the course offering, the state becomes closed.

Behavior determines how an object responds to requests from other objects and typifies everything the object can do. Behavior is implemented by the set of operations for the object. In the registration system, a course offering could have the behaviors add a student and delete a student.

Identity means that each object is unique ”even if its state is identical to that of another object. For example, Algebra 101, Section 1, and Algebra 101, Section 2 are two objects in the Course Registration System. Although they are both course offerings, they each have a unique identity.

In the UML, objects are represented as rectangles and the name of the object is underlined as shown in Figure 4-1.

Figure 4-1. UML Notation for an Object

graphics/04fig01.gif

I l @ ve RuBoard


Visual Modeling with Rational Rose 2002 and UML
Visual Modeling with Rational Rose 2002 and UML (3rd Edition)
ISBN: 0201729326
EAN: 2147483647
Year: 2002
Pages: 134

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net