Previous | Table of Contents | Next |
Note –
(additional properties - see “Classifier? on page 127).
Description
Constructs::Classifier is defined in the Classifiers diagram. A Classifier is a Type. The Classes diagram adds the association
between Classifier and Property that represents the attributes of the classifier.
Generalizations
• “Type? on page 130
• “Namespace? on page 143
Attributes
No additional attributes
Associations
• attribute: Property [*] Refers to all of the Properties that are direct (i.e., not inherited or imported) attributes of
the classifier. Subsets Classifier::feature and is a derived union.
Constraints
No additional constraints
Semantics
All instances of a classifier have values corresponding to the classifier’s attributes.
Semantic Variation Points
The precise lifecycle semantics of aggregation is a semantic variation point.
Notation
An attribute can be shown as a text string. The format of this string is specified in the Notation subsection of “Property?
on page 122.
All redefinitions shall be made explicit with the use of a {redefines <x> } property string. Redefinition prevents inheritance
of a redefined element into the redefinition context, thereby making the name of the redefined element available for reuse,
either for the redefining element, or for some other.
Presentation Options
The type, visibility, default, multiplicity, property string may be suppressed from being displayed, even if there are values
in the model.
The individual properties of an attribute can be shown in columns rather than as a continuous string.
The attribute compartment is often suppressed, especially when a data type does not contain attributes. The operation compartment
may be suppressed. A separator line is not drawn for a missing compartment. If a compartment is suppressed, no inference can
be drawn about the presence or absence of elements in it. Compartment names can be used to remove ambiguity, if necessary.
Additional compartments may be supplied to show other predefined or user-defined model properties (for example, to show business
rules, responsibilities, variations, events handled, exceptions raised, and so on). Most compartments are simply lists of
strings, although more complicated formats are also possible. Appearance of each compartment should preferably be implicit
based on its contents. Compartment names may be used, if needed.
A data-type symbol with a stereotype icon may be “collapsed? to show just the stereotype icon, with the name of the data type
either inside the rectangle or below the icon. Other contents of the data type are suppressed.
Style Guidelines
• Center the name of the data type in boldface.
• Center keyword (including stereotype names) in plain face within guillemets above data-type name.
• For those languages that distinguish between uppercase and lowercase characters, capitalize names (i.e., begin them with an uppercase character).
• Left justify attributes and operations in plain face.
• Begin attribute and operation names with a lowercase letter.
• Show full attributes and operations when needed and suppress them in other contexts or references.
Attribute names typically begin with a lowercase letter. Multiword names are often formed by concatenating the words and using
lowercase for all letters, except for upcasing the first letter of each word but the first.
Examples
The attributes in
Figure 11.14
are explained below.
• ClassA::name is an attribute with type String.
• ClassA::shape is an attribute with type Rectangle.
• ClassA::size is a public attribute with type Integer with multiplicity 0..1.
• ClassA::area is a derived attribute with type Integer. It is marked as read-only.
• ClassA::height is an attribute of type Integer with a default initial value of 5.
• ClassA::width is an attribute of type Integer.
• ClassB::id is an attribute that redefines ClassA::name.
• ClassB::shape is an attribute that redefines ClassA::shape. It has type Square, a specialization of Rectangle.
• ClassB::height is an attribute that redefines ClassA::height. It has a default of 7 for ClassB instances which overrides the ClassA default of 5.
• ClassB::width is a derived attribute that redefines ClassA::width, which is not derived.
An attribute may also be shown using association notation, with no adornments at the tail of the arrow as shown in Figure
11.15
.
Figure 11.15 - Association-like notation for attribute
UML Infrastructure Specification, v2.0