Login | Register
My pages Projects Community openCollabNet

18.7. Attribute

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 Feature.

An attribute is represented in the diagram on a single line within the attribute compartment of the class. Its syntax is as follows:

visibility attributeName : type [= initialValue]

visibility is +, #, - or ~ corresponding to public, protected, private, or package visibility respectively.

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.

18.7.1. Attribute Details Tabs

The details tabs that are active for attributes are as follows.


Standard tab.


See Section 18.7.2, “Attribute Property Toolbar” and Section 18.7.3, “Property Fields For Attribute” below.


Standard tab. See Section 13.4, “Documentation Tab”.


Standard tab. There are no standard constraints defined for Attribute within the UML metamodel.


Standard tab.

Tagged Values

Standard tab. In the UML metamodel, Attribute has the following standard tagged values defined.

  • transient.

  • 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).


The UML Element metaclass from which all other model elements are derived includes the tagged element documentation which is handled by the documentation tab under ArgoUML


Standard tab for a Attribute.

18.7.2. Attribute Property Toolbar

Go up

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.

New attribute

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.

New Datatype

This creates a new Datatype (see Section 16.3, “Datatype”) for the selected attribute, navigating immediately to the properties tab for that datatype.

New Enumeration

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.

New Stereotype

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.

18.7.3. Property Fields For Attribute


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”.

The value 1..1 is equivalent to the default (exactly one scalar instance). The selection 0..1 indicates an optional scalar attribute.


Radio box, with entries public, private, protected and package.

  • public. The attribute is available to any model element that can see the owning class.

  • private. The attribute is available only to the owning class (and any inner classes).

  • 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 same package.


Radio box, with entries addOnly, changeable, and frozen.

  • 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 or altered.

  • 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 static. If 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 Classifier, although in practice only Class, DataType, or Interface make any sense.

Pressing the navigation button will navigate to the property panel for the currently selected type. (see Section 18.6, “Class”, Section 18.3, “Datatype” and Section 18.16, “Interface”).


A type must be declared (it can be void). By default ArgoUML supplies int as the type.

Initial Value

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 common values 0, 1, 2, and null.

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 Body or Language, to help remember which is which.


Any constructor operation may ignore this initial value.