Study Cards on visibilitykind, literals, enumeration
Can you find them?
A common enumeration, that of TrafficLightColor is shown in both a US and UK style.
UML uses the VisibilityKind to identify the visibility of attributes and operations.
The EbookKind is a useful library domain enumeration for electronic books.
The standard name for the compartment showing the enumeration literals is “literals.”
In a class diagram, a member, i.e., an attribute or operation, would be preceded by one of the listed symbols to indicate the visibility
The member value/behavior may be seen or invoked by anyone
Private, but instances of specializations of the class can also access
In the UML specification, all the enumeration type names end with “Kind,” such as shown with VisibilityKind in Fig. 6.5.
We followed that reasonable convention with our own enumerations, but you may follow your own approach if you want.
In the figure, we included both TrafficLightColorKind and TrafficLightColourKind, to support both US and UK style traffic signals.
How can you test equality between two values?
If you wish to refer to each color independently, you use the “.” naming scope operator, as shown below.
Examine Fig. 6.6. How many literals does the
DirectionalTrafficLightColor have?
They could be strings, integers starting with one, or integers starting with zero, or something else.
Some tools may allow you to specify values or an order to the literals for code generation, but that is not part of current UML.
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding

- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding