Enumeration
Last updated
Last updated
An Enumeration, often referred to as an Enum, is a special data type in UML and object-oriented programming that consists of a set of named constants. In Modeldraw, you can use Enumerations to model fixed sets of values in your system design, providing a way to represent concepts like days of the week, card suits, or status types.
Enumeration represents a fixed set of constants or instances in a system. Key characteristics include:
It defines a collection of related, named values
The set of values is finite and usually small
Each value in the enumeration is unique
Enumerations are often used to represent conceptual types with a limited number of possible values
Enumeration is represented in UML by a class-like structure with the «enumeration» stereotype.
Examples of enumerations:
Days of the Week: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
Card Suits: Hearts, Diamonds, Clubs, Spades
Traffic Light Colors: Red, Yellow, Green
The relationship between a class using an enumeration and the enumeration itself in Modeldraw is a dependency, not an aggregation or composition.
To create a new Enumeration:
Select the Enumeration tool from the toolbox
Click on the canvas where you want to place the Enumeration
To create a Dependency between a Class and an Enumeration:
Select the Dependency tool from the toolbox
Click on a Class that uses the Enumeration
Move above and click the Enumeration
To add an existing Enumeration to a diagram:
Open the diagram you want to add the Enumeration to
Drag and drop the Enumeration from the navigation tree into the diagram