HOPEX UML : HOPEX UML : The Class Diagram : Object Diagram
   
Object Diagram
 
Objects
Creating an object (instance)
Instance properties
Value of an attribute
Links
Creating a link
Link properties
Role properties
An object diagram or instance diagram contains objects with values illustrating their attributes and links. It shows in detail the state of the system at a given moment.
You can create the object diagram of a class, component, package or use case.
Objects
An object is an entity with a well-defined boundary and identity that encapsulates state and behavior. Its state is represented by the values of its attributes and its relationships with other objects. Its behavior is represented by its operations and methods. An object is an instance of a class.
Examples of objects:
Business objects:
John Williams, Elizabeth Davis, Paul Smith are instances of the person class.
Orders 10533 and 7322 are instances of the order class.
Sony SPD-1730 Monitor, Compaq Deskpro 200 are instances of the item class.
Dupont and Burger King are instances of the company class.
Technical objects used for programming:
Dlg_Order_Create, Dlg_Client_Query are instances of the window class.
Str_Client_Name, Str_Product_Comment are instances of the string class.
*The objects represented in an object diagram can be instances of a class, package, use case, component, or node, to enable defining sequence diagrams at the desired level of detail.
Creating an object (instance)
To create an object:
1. Click the Instance button
You can create objects of different types. The arrow at the right of the button offers a shortcut to Class and Component object types, the most frequently used.
2. Then click in the diagram workarea.
The dialog box enabling addition of an instance opens.
3. Enter the instance Name.
4. Specify the Instance Type if necessary.
5. Click Create.
The instance appears in the diagram.
Instance properties
To open the properties dialog box of an instance:
*Right-click the instance and select Properties.
Several tabs allow you to define the properties of an instance.
 
You can:
Select the Instance kind (Actor, Class, etc.).
You can specify of which Class, Actor, etc. this object is an instance.
Indicate a name for this instance.
Specify its Stereotype.
Value of an attribute
To specify the value of an attribute:
1. Right-click the class instance containing the attribute.
2. Select Attributes.
3. In the dialog box that opens, indicate the value of the attribute. You can specify an instanced value or a constant value.
Instanced value: click in this column to display the list of possible instances for the selected attribute. These are variable values.
Value: click in the column and enter the value of the attribute.
Links
A link represents an instance of an association between two objects.
Examples of links between objects:
Order no. 10733 was placed by John Williams.
Order no. 10733 includes the products Sony SPD-1730 Monitor and Compaq Deskpro 200.
John Williams works for Dupont.
The window Dlg_Client_Query displays the string Str_Client_Name.
Creating a link
To create a link:
1. Click the Link button in the toolbar.
2. Click one of the objects concerned, and drag the mouse to the second object before releasing the mouse button.
The link then appears in the diagram.
If there is already a link between the two objects, a dialog box asks you to choose an existing link or create a new one.
Link properties
To open the properties dialog box of a link:
*Right-click the center of the link and select Properties.
Its dialog box appears.
 
*If you do not click on the center of the link, the properties dialog box for one of the roles will be displayed.
In the Characteristics tab, you can specify:
The Name of the link.
The link Stereotype.
The Association corresponding to the link.
The Package containing the link.
In the Link Role subtab of the link you can specify:
For each Instance connected by this link, the name of the Role and its Multiplicity.
*Only the associations between the classes of the two instances are listed.
Role properties
To open the properties dialog box of a role:
1. In the Properties dialog box of the link, select the Link End tab.
2. Right-click the role and select Properties.
The Properties dialog box of the role opens.
 
In this dialog box you can specify:
A Name for the role.
The Role for this instance.
The Multiplicity for the role.
The values for the role Qualifiers, defined at the class level.