Attribute is a named slot within a class (or other
Classifier) describing a range of values
that may be held by instances of the class. In the UML
metamodel it is a sub-class of
StructuralFeature which is itself a sub-class of
An attribute is represented in the diagram on a single line within the attribute compartment of the class. Its syntax is as follows:
~ corresponding to
attributeName is the actual name of the attribute being declared.
type is the type (UML datatype, class or interface) declared for the attribute.
initialValue is any initial value to be given to the attribute when an instance of the class is created. This may be overridden by any constructor operation.
In addition any attribute declared static will have its whole entry underlined on the diagram.
The details tabs that are active for attributes are as follows.
Standard tab. See Section 13.4, “Documentation Tab”.
Standard tab. There are no standard constraints
Attribute within the UML
Standard tab. In the UML metamodel,
Attribute has the following standard tagged
volatile. This is an
ArgoUML extension to the UML 1.4 standard to
indicate that this attribute is realized in some
volatile form (for example it will be a memory
mapped control register).
Standard tab for a Attribute.
Navigate up through the package structure.
Go to Previous
Navigate to the previous attribute of the class that owns them. This button is downlighted if the current attribute is the first one.
Go to Next
Navigate to the next attribute of the class that owns them. This button is downlighted if the current attribute is the last one.
This creates a new attribute within the owning class of the current attribute, navigating immediately to the properties tab for that attribute.
This is a very convenient way to add a number of attributes, one after the other, to a class.
This creates a new Datatype (see Section 16.3, “Datatype”) for the selected attribute, navigating immediately to the properties tab for that datatype.
This creates a new Enumeration (see Section 16.4, “Enumeration”) for the package that owns the class, navigating immediately to the properties tab for that enumeration.
This creates a new Stereotype (see Section 16.6, “Stereotype”) for the selected attribute, navigating immediately to the properties tab for that stereotype.
This deletes the attribute from the model
This is a deletion from the model not just the diagram. If desired the whole attribute compartment can be hidden on the diagram using the style tab (see Section 18.7.2, “Attribute Property Toolbar”) or the button 2 pop up menu for the class on the diagram.
Text box. The name of the attribute. The name of a attribute has a leading lower case letter, with words separated by “bumpy caps”.
The ArgoUML critics will complain about attribute names that do not have an initial lower case letter.
Text box. Records the class which contains this attribute.
Button 1 double click on the entry will navigate to the class.
Editable drop down selector with checkmark. The default value (1) is that there is one instance of this attribute for each instance of the class, i.e. it is a scalar. The drop down provides a number of commonly used specifications for non-scalar attributes.
When the checkmark is unchecked, then the multiplicity remains undefind in the model (and the drop down selector is downlighted).
ArgoUML presents a number of predefined ranges for multiplicity for easy access. The user may also enter any user defined range that follows the UML syntax, such as “1..3,7,10”.
Radio box, with entries
public. The attribute is
available to any model element that can see the owning
private. The attribute is
available only to the owning class (and any inner
protected. The attribute
is available only to the owning class, or model elements
that are subclasses of the owning class.
package. The attribute
is available only to model elements contained in the
Radio box, with entries
addOnly. Meaningful only
if the multiplicity is not fixed to a single value.
Additional values may be added to the set of
values, but once created a value may not be removed
changeable. There are no
restrictions of modification.
frozen. Also named
“immutable”. The value of the
attribute may not change during the lifetime of the
owner class. The value must be set at object
creation, and may never change after that. This
implies that there is usually an argument for this
value in a constructor and that there is no
operation that updates this value.
Check box for
unchecked (the defaults) then the attribute has
“instance scope”. If checked, then the
attribute is static, i.e. it has “class
scope”. Static attributes are indicated on the
diagram by underlining.
Drop down selector with navigation button.
The type of this attribute.
This can be any UML
although in practice only
Interface make any sense.
A type must be declared (it can be
Text box with 2 compartments.
This allows you to set
an initial value for the attribute if desired (this is
optional). The drop down menu provides access to the
The left hand side of this field contains the body of the expression that forms the initial value. The right hand side defines the language in which the expression is written.
Hovering the mouse pointer over these fields,
reveals a tooltip
to help remember which is which.
Any constructor operation may ignore this initial value.