Enumeration can be thought of as simple classes. They have no attributes, and any operations on them must have no side-effects. A useful analogy is primitive datatypes in a language like Java. The boolean “true” stands on its own—it has no inner structure. There are operations (for example logical xor) on the booleans, but when I perform true xor true the result is a new boolean, and the original 2 booleans “true” are unchanged by the exercise.
Within UML 1.4, Enumeration is a sub-class of the DataType metaclass.
The big difference with other DataTypes, is that an Enumeration has EnumerationLiterals. E.g. the Enumeration “boolean” is defined as having 2 EnumerationLiterals, “true” and “false”.
Within ArgoUML new enumerations may be created using the New Enumeration button on the property tabs of the model and packages (in which case the new enumeration is restricted in scope to the package), as well as the properties tab for datatype and enumeration.
![]() | Note |
---|---|
UML 1.4 allows user defined datatypes to be placed on class diagrams. This is not yet possible in ArgoUML. |
The details tabs that are active for enumerations are as follows.
Standard tab.
See Section 15.4.2, “Enumeration Property Toolbar” and Section 15.4.3, “Property Fields For Enumeration” below.
Standard tab. See Section 12.4, “Documentation Tab”.
Standard tab.
Standard tab. The UML metamodel has the following stereotypes defined by default for a Classifier, which also apply to an Enumeration:
metaclass (from the superclass, Classifier).
powertype (from the superclass, Classifier).
process (from the superclass, Classifier).
thread (from the superclass, Classifier).
utility (from the superclass, Classifier).
Standard tab. In the UML metamodel, Enumeration has no standard tagged values defined.
Navigate up through the composition structure.
This creates a new datatype (see Section 17.5, “Class”) within the same package as the current enumeration.
This creates a new enumeration literal within the enumeration, navigating immediately to the properties tab for that literal.
This creates a new operation within the enumeration, navigating immediately to the properties tab for that operation.
This creates a new Stereotype (see Section 15.5, “Stereotype”) within the same package as the enumeration, navigating immediately to the properties tab for that stereotype.
This deletes the datatype from the model.
Text box. The name of the enumeration. The primitive enumerations all have lower case names, but there is no formal convention.
![]() | Note |
---|---|
The default name supplied for a newly created datatype is the empty string “”. Enumerations with empty string names will appear with the name (anon Enumeration) in the explorer. |
Drop down selector. Allows changeing the namespace for the enumeration. This is the composition hierarchy.
Check box, with entries Abstract, Leaf and Root.
Abstract is used to declare that this enumeration cannot be instantiated, but must always be specialized.
![]() | Note |
---|---|
ArgoUML provides no mechanism for specializing enumerations, so this check box is of little use. |
Leaf indicates that this enumeration can have no further sub-types, while Root indicates it is a top level enumeration.
![]() | Tip |
---|---|
In the absence of specialization of enumerations within ArgoUML these have little value. In effect all enumerations are both Root and Final |
Radio box, with entries public, private, protected, and package.
Records the visibility for the Enumeration.
Text area. Lists any elements that depend on this enumeration.
![]() | Caution |
---|---|
It is not clear that defining dependencies between enumerations makes much sense. |
Text area. Lists any elements that this enumeration depends on.
![]() | Caution |
---|---|
It is not clear that defining dependencies between enumeration makes much sense. |
Text area. Lists any enumeration that generalizes this enumeration.
Text box. Lists any specialized enumerations (i.e. for which this enumeration is a generalization.
Text area. Lists all the operations defined on this enumeration. Button 1 double click navigates to the selected operation. button 2 click brings up a pop up menu with two entries.
Move Up. Only available where there are two or more operations, and the operation selected is not at the top. It is moved up one.
Move Down. Only available where there are two or more operations listed, and the operation selected is not at the bottom. It is moved down one.
See Section 17.7, “Operation” for details of operations.
![]() | Caution |
---|---|
ArgoUML treats all operations as equivalent. Any operations created here will use the same mechanism as operations for classes. Remember that operations on enumerations must have no side effects (they are read-only). This means the query modifier must be checked for all operations. |
Text area. Lists all the enumeration literals defined for this enumeration. Button 1 double click navigates to the selected literal, button 2 click brings up a pop up menu with two entries.
Move Up. Only available where there are two or more literals, and the literal selected is not at the top. It is moved up one.
Move Down. Only available where there are two or more literals listed, and the literal selected is not at the bottom. It is moved down one.