Previous Table of Contents Next


9.10.1 InstanceSpecification


   An instance specification is a model element that represents an instance in a modeled system.

   Description

   An instance specification specifies existence of an entity in a modeled system and completely or partially describes the entity. The description includes:

   InstanceSpecification is a concrete class.

   Generalizations

   • “NamedElement? on page 71

   Attributes

   No additional attributes

   Associations

   Constraints

   [1] The defining feature of each slot is a structural feature (directly or inherited) of a classifier of the instance specification.

   slot->forAll(s |

   classifier->exists(c | c.allFeatures()->includes(s.definingFeature))

   )

   [2] One structural feature (including the same feature inherited from multiple classifiers) is the defining feature of at most one slot in an instance specification.

   classifier->forAll(c |

   (c.allFeatures()->forAll(f | slot->select(s | s.definingFeature = f)->size() <= 1)

   )

   Semantics

   An instance specification may specify the existence of an entity in a modeled system. An instance specification may provide an illustration or example of a possible entity in a modeled system. An instance specification describes the entity. These details can be incomplete. The purpose of an instance specification is to show what is of interest about an entity in the modeled system. The entity conforms to the specification of each classifier of the instance specification, and has features with values indicated by each slot of the instance specification. Having no slot in an instance specification for some feature does not mean that the represented entity does not have the feature, but merely that the feature is not of interest in the model.

   An instance specification can represent an entity at a point in time (a snapshot). Changes to the entity can be modeled using multiple instance specifications, one for each snapshot.

   When used to provide an illustration or example of an entity in a modeled system, an InstanceSpecification class does not depict a precise run-time structure. Instead, it describes information about such structures. No conclusions can be drawn about the implementation detail of run-time structure. When used to specify the existence of an entity in a modeled system, an instance specification represents part of that system. Instance specifications can be modeled incompletely, required structural features can be omitted, and classifiers of an instance specification can be abstract, even though an actual entity would have a concrete classification.

   Notation

   An instance specification is depicted using the same notation as its classifier, but in place of the classifier name appears an underlined concatenation of the instance name, a colon (‘:’) and the classifier name or names. The convention for showing multiple classifiers is to separate their names by commas.

   Names are optional for UML 2 classifiers and instance specifications. The absence of a name in a diagram may reflect its absence in the underlying model.

   The standard notation for an anonymous instance specification of an unnamed classifier is an underlined colon (' :').

   If an instance specification has a value specification as its specification, the value specification is shown either after an equal sign (“=?) following the name, or without an equal sign below the name. If the instance specification is shown using an enclosing shape (such as a rectangle) that contains the name, the value specification is shown within the enclosing shape.


   Figure 9.26 - Specification of an instance of String

   Slots are shown using similar notation to that of the corresponding structural features. Where a feature would be shown textually in a compartment, a slot for that feature can be shown textually as a feature name followed by an equal sign (‘=’) and a value specification. Other properties of the feature, such as its type, can optionally be shown.


   Figure 9.27 - Slots with values

   An instance specification whose classifier is an association represents a link and is shown using the same notation as for an association, but the solid path or paths connect instance specifications rather than classifiers. It is not necessary to show an underlined name where it is clear from its connection to instance specifications that it represents a link and not an association. End names can adorn the ends. Navigation arrows can be shown, but if shown, they must agree with the navigation of the association ends.


   father son


   Figure 9.28 - Instance specifications representing two objects connected by a link Presentation Options

   A slot value for an attribute can be shown using a notation similar to that for a link. A solid path runs from the owning instance specification to the target instance specification representing the slot value, and the name of the attribute adorns the target end of the path. Navigability, if shown, must be only in the direction of the target.