Overview of instance modeling
The instance model is made up of Instances and links that are based on the class model. An Instance is an instance of a Class, Data Type, Interface or Signal that shows features (Attributes and Roles) of that item through Slots. Each Slot corresponds to a single feature, and a Slot may include a value.
Instances and their relationships with each other can be shown on Object Diagrams. After modeling Instances, those Instances can be used on Communication Diagrams and Sequence Diagrams.
Object diagrams
An Object Diagram shows instances of Classes, Data Types, Interfaces and Signals and Instance Nesting through Links.
You can create an Object Diagram through the context menu of the Model or a Package.
Through an Object Diagram you can create new instances of Classes, Data Types, Interfaces and Signals, either by dragging the item that is to be the Instance's classifier to the diagram, or through the
Instance button on the Object Diagram tab.
For more information about Object Diagrams, see the following topics:
Instances
An Instance item models an instance of a Class, Data Type, Interface or Signal. A Class, Data Type, Interface or Signal can have many Instances.
Through the Packages pane, you can create an Instance through the context menu of the Model, a Package, Class, Data Type, Interface or Signal. When you create an Instance through a Class, Data Type, Interface or Signal, that item is set up as the Instance's classifier. You can also create Instances through an Object Diagram
You can set an Instance's classifier by dragging the Class, Data Type, Interface or Signal to the Instance, or through the Type tab of an Instance's Property Pages.
When shown on an Object Diagram or Communication Diagram, an Instance's notation is as follows.
On a Sequence Diagram, Slots are not shown by default, but they can be shown by changing the Instance's View Options.
For more information about Instances, see the following topics:
Nested instances
Instances can be nested when their classifiers have a part relationship with each other. When an Instance nests another Instance, the Slot that is created for the part (Attribute or Role) has its Linked Values value set to the nested Instance.
Instance nesting can be shown on an Instance Diagram through Links or containment, as shown in the following example.
You can create nested Instances on an Object Diagram - right-click an Instance, point to Populate, and then click Create Instances of Parts.
In the Packages pane, you can make an Instance nest a valid Instance by dragging the Instance you want to nest to the other Instance. On an Object Diagram you can make an Instance nest a valid Instance by creating a link between the two Instances.
For more information about nesting Instances, see the following topics:
Slots
A Slot corresponds to a single feature, and a Slot may include a value.
When you create an Instance for a Class, Data Type, Interface or Signal, Modeler automatically creates a virtual Slot for the following Attributes and Roles:
• The Attributes and Roles of the Instance's Class, Data Type, Interface or Signal.
• The Attributes and Roles of Classes, Data Types, Interfaces and Signals from which the Instance's Class, Data Type, Interface or Signal inherits through a Generalization relationship.
• The Attributes and Roles of template Classes, Data Types, Interfaces and Signals from which the Instance's Class, Data Type, Interface or Signal inherits through a bind Dependency.
The virtual Slots are listed on the Slot Values tab of the Instance's Property Pages. Note that you can tell they are virtual Slots because the
Delete Slot button is not enabled when a virtual Slot is selected, and if you click the
Properties button, Modeler opens the Property Pages for the Attribute or Role. In addition, virtual Slots are not shown on Object Diagrams.
When you set a Text Value or Linked Values for a Slot, Modeler creates a child Slot item to store the Text Value or Linked Values you have set. You can only have a Text Value or Linked Values, not both.
You can create a Specification Slot for an instance through the Slot Values tab of an Instance's Property Pages.
For more information about Slots, see the following topics:
Linked values
When selecting items to be Linked Values, only valid items can be selected. If the multiplicity of a slot's underlying Role or Attribute is 'zero or one' or 'only one', then only one item can be linked as the linked value.
For a Slot that has been created for an Attribute or Role, Linked Values can be valid Attributes, Instances and Enumeration Literals. In addition, a Specification Slot's Linked Values can include valid States:
• Attributes can be used as Linked Values under the following conditions:
◦ The Attribute is typed by the Class, Data Type, Interface or Signal that is the Slot's feature's type.
◦ The Attribute is Read-only
◦ The Attribute has On Class storage.
Note that if the Slot's feature is untyped, that Slot can use as Linked Values any Attribute that is Read-only with On Class storage.
For example:
• Instances can be used as Linked Values when they are Instances of the Slot's feature's type.
For example:
• Enumeration Literals can be used as Linked Values when they are owned by the Type Definition that is the Slot's feature's type.
For example:
• States can be used as Linked Values for the Specification Slot when those States are owned by the Class or Interface that is the Slot's feature's type.
For more information about setting Linked Values, see
Setting a text value or linked values of a slot.