OCUP part 4: Metamodel instances in a composite structure diagram

How exactly does a given Composite Structure diagram map to the UML Metamodel? First some definitions form the UML spec:

„Connector=link that enable communication between two or more instances. Each connector may be attached to two or more connectable elements, each representing a set of instances“. This states that the instances in the Composite Structure diagram are represented by ConnectableElements (which are abstract and subclassed by Property). Looking at a composite structure diagram, one may mistake those Properties as Objects, but they are not.

„A property specifying an instance that is not owned by the instance of the containing classifier is shown by graphical nesting of a box with a dashed outline. The contained box symbol [of a part (represented by a solid box)] has only a name compartment, which contains a string according to the syntax defined in the notation sub clause of ‚Property'“. This indicates that the whole diagram is based on the viewpoint of the containing [structured] classifier. The following two images show the class diagram and the composite structure diagram from the viewpoint of the class „car“.

car-wheel-axle

car-wheel-axle

composite structure car-wheel-axle

composite structure car-wheel-axle

 

„A property symbol may be shown containing just a single name (without the colon) in its name string. This implies the definition of an anonymously named class nested within the namespace of the containing class“.

To sum it up: Take a structured classifier. To make a composite structure diagram for this class, take the properties that are linked to it by composition and represent them with a solid box. All relevant Properties that are not owned [by composition] can be represented via a dashed box. One hint to represent the composite structure diagram as a set of metamodel instances: The Association (which is part of the fundamental certification) can own Properties (association ends) that are not owned by a class. Here is a very simple class diagram and its representation as a set of metamodel instances:

class_car_wheel

class_car_wheel

car-wheel as metamodel instances

car-wheel as metamodel instances

 

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.