Version 11.1 by Helena on 2025/05/22 13:28

Show last authors
1 {{box title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 == {{id name="_Toc371089"/}}14.1 Scope ==
6
7 The scope of this document is to give a brief overview of the diagram notation used in UML. The examples used in this document have been taken from the SDMX UML model.
8
9 == {{id name="_Toc371090"/}}14.2 Use Cases ==
10
11 In order to develop the data models it is necessary to understand the functions that require to be supported. These are defined in a use case model. The use case model comprises actors and use cases and these are defined below.
12
13 The **actor** can be defined as follows:
14
15 “//An actor defines a coherent set of roles that users of the system can play when interacting with it. An actor instance can be played by either an individual or an external system”//
16
17 The actor is depicted as a stick man as shown below.
18
19
20 Data Publisher
21
22 **Figure 46 Actor**
23
24 The **use cas**e can be defined as follows:
25
26 “//A use case defines a set of use-case instances, where each instance is a sequence of actions a system performs that yields an observable result of value to a particular actor”//
27
28
29 Publish Data
30
31 **Figure 47 Use case**
32
33
34 Publish Data Data Publisher
35
36 **Figure 48 Actor and use case**
37
38
39
40 **Figure 49 Extend use cases**
41
42 An extend use case is where a use case may be optionally extended by a use case that is independent of the using use case. The arrow in the association points to he owning use case of the extension. In the example above the Uses Data use case is optionally extended by the Uses Metadata use case.
43
44 == {{id name="_Toc371091"/}}14.3 Classes and Attributes ==
45
46 === {{id name="_Toc371092"/}}14.3.1 General ===
47
48 A class is something of interest to the user. The equivalent name in an entity-relationship model (E-R model) is the entity and the attribute. In fact, if the UML is used purely as a means of modelling data, then there is little difference between a class and an entity.
49
50 **Figure 50 Class and its attributes**
51
52 Figure 50 shows that a class is represented by a rectangle split into three compartments. The top compartment is for the class name, the second is for attributes and the last is for operations. Only the first compartment is mandatory. The name of the class is Annotation, and it belongs to the package SDMX-Base. It is common to group related artefacts (classes, use-cases, etc.) together in packages. . Annotation has three “String” attributes – name, ,,type,,, and ,,url,,. The full identity of the attribute includes its class e.g. the name attribute is Annotation.name.
53
54 Note that by convention the class names use UpperCamelCase – the words are concatenated and the first letter of each word is capitalized. An attribute uses lowerCamelCase - the first letter of the first (or only) word is not capitalized, the remaining 2469 words have capitalized first letters.
55
56 === {{id name="_Toc371093"/}}14.3.2 Abstract Class ===
57
58 An abstract class is drawn because it is a useful way of grouping classes, and avoids drawing a complex diagram with lots of association lines, but where it is not foreseen that the class serves any other purpose (i.e. it is always implemented as one of its sub classes). In the diagram in this document an abstract class is depicted with its name in italics, and coloured white.
59
60 **Figure 51 Abstract and concrete classes**
61
62 == {{id name="_Toc371094"/}}14.4 Associations ==
63
64 === {{id name="_Toc371095"/}}14.4.1 General ===
65
66 In an E-R model these are known as relationships. A UML model can give more meaning to the associations than can be given in an E-R relationship. Furthermore, the UML notation is fixed (i.e. there is no variation in the way associations are drawn). In an E-R diagram, there are many diagramming techniques, and it is the relationship in an E-R diagram that has many forms, depending on the particular E-R notation used.
67
68 === {{id name="_Toc371096"/}}14.4.2 Simple Association ===
69
70
71 **Figure 52 A simple association**
72
73 Here the ,,DataflowDefinition,, class has an association with the DataStructureDefinition class. The diagram shows that a DataflowDefinition can have an association with only one ,,DataStructureDefinition,, (1) and that a DataStructureDefinition can be linked to many DataflowDefinitions (0..*). The association is sometimes named to give more semantics.
74
75 In UML it is possible to specify a variety of “multiplicity” rules. The most common ones are:
76
77 1.
78 1*. Zero or one (0..1)// //
79 1*. Zero or many (0..*)// //
80 1*. One or many (1..*)// //
81 1*. Many (*)// //
82 1*. Unspecified (blank)// //
83
84 === {{id name="_Toc371097"/}}14.4.3 Aggregation ===
85
86 **Figure 53: A simple aggregate association**
87
88 **Figure 54 A composition aggregate association**
89
90 An association with an aggregation relationship indicates that one class is a subordinate class (or a part) of another class. In an aggregation relationship. There are two types of aggregation, a simple aggregation where the child class instance can outlive its parent class, and a composition aggregation where the child class's instance lifecycle is dependent on the parent class's instance lifecycle. In the simple aggregation it is usual, in the SDMX Information model, for this association to also be a reference to the associated class.
91
92 === {{id name="_Toc371098"/}}14.4.4 Association Names and Association-end (role) Names ===
93
94 It can be useful to name associations as this gives some more semantic meaning to the model i.e. the purpose of the association. It is possible for two classes to be joined by two (or more) associations, and in this case it is extremely useful to name the purpose of the association.
95
96 Figure 55 shows a simple aggregation between CategoryScheme and Category called ///items //(this means it is derived from the association between the super classes – in this case between the //ItemScheme// and the //Item,// and another between Category called ///hierarchy//.
97
98
99 **Figure 55 Association names and end names**
100
101 Furthermore, it is possible to give role names to the association-ends to give more semantic meaning – such as parent and child in a tree structure association. The role is shown with “+” preceding the role name (e.g. in the diagram above the semantic of the association is that a Item can have zero or one parent Items and zero or many child Item).
102
103 In this model the preference has been to use role names for associations between concrete classes and association names for associations between abstract classes. The reason for using an association name is often useful to show a physical association between two sub classes that inherit the actual association between the super class from which they inherit. This is possible to show in the UML with association names, but not with role names. This is covered later in “Derived Association”.
104
105 Note that in general the role name is given at just one end of the association.
106
107 === {{id name="_Toc371099"/}}14.4.5 Navigability ===
108
109 Associations are, in general, navigable in both directions. For a conceptual data model it is not necessary to give any more semantic than this.
110
111 However, UML allows a notation to express navigability in one direction only. In this model this “navigability” feature has been used to represent referencing. In other words, the class at the navigable end of the association is referenced from the class at the non-navigable end. This is aligned, in general, with the way this is implemented in the XML schemas.
112
113
114 **Figure 56 One way association**
115
116 Here it is possible to navigate from A to B, but there is no implementation support for navigatation from B to A using this association.
117
118 === {{id name="_Toc371100"/}}14.4.6 Inheritance ===
119
120 Sometimes it is useful to group common attributes and associations together in a super class. This is useful if many classes share the same associations with other classes, and have many (but not necessarily all) attributes in common. Inheritance is shown as a triangle at the super class.
121
122
123 **Figure 57 Inheritance**
124
125 Here the Dimension is derived from Component which itself is derived from
126
127 //IdentifiableArtefact//. Both Component and IdentifiableArtefact are abstract superclasses. The Dimension inherits the attributes and associations of all of the the super classes in the inheritance tree. Note that a super class can be a concrete class (i.e. it exists in its own right as well as in the context of one of its sub classes), or an abstract class.
128
129 === {{id name="_Toc371101"/}}14.4.7 Derived association ===
130
131 It is often useful in a relationship diagram to show associations between sub classes that are derived from the associations of the super classes from which the sub classes inherit. A derived association is shown by “/” preceding the association name e.g. ///name//.
132
133
134 **Figure 58 Derived associations**