Modeldraw
  • Welcome to Modeldraw
  • Getting Started
    • Quickstart Guide
  • FAQ
  • UML Designer
    • Common Elements
      • Comment
      • Comment Link
      • Dependency
      • Realization
      • Frame
    • Class Diagrams
      • Class
      • Association
      • Generalization
      • Composition
      • Aggregation
      • Enumeration
      • Interface
      • Association Class Link
      • Ball (Interface Realization)
      • Socket (Required Interface)
    • Sequence Diagrams
      • Lifeline
      • Activation Bar
      • Synchronous Message
      • Asynchronous Message
      • Return Message
      • Found Message
      • Interaction Frame
    • Use Case Diagrams
      • Actor
      • Use Case
      • Association
      • System Boundary
      • Generalization
      • Include Relationship
      • Extend Relationship
    • State Machine Diagrams
      • State
      • Initial State
      • Final State
      • Transition
      • Superstate
      • Concurrent Boundary
      • History Pseudostate
      • History Transition
    • Package Diagrams
      • Package
    • Deployment Diagrams
      • Node
      • Communication Path
      • Deployed Artifact
      • Internet
    • Activity Diagrams
      • Initial Node
      • Activity Final
      • Action
      • Flow
      • Decision / Merge
      • Fork / Join
      • Partitions
      • Flow Final
      • Send Signal
      • Accept Signal
      • Time Signal
    • Component Diagrams
      • Component
      • Ball (Interface Realization)
      • Socket (Required Interface)
    • Communication Diagrams
      • Object
      • Link
  • Wireframes
    • Views
    • Layouts
    • Components
Powered by GitBook
On this page
  • Understanding Enumeration
  • Creating an Enumeration
  • Adding a Dependency
  • Adding an Existing Enumeration to a Diagram
  1. UML Designer
  2. Class Diagrams

Enumeration

PreviousAggregationNextInterface

Last updated 7 months ago

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.

Understanding Enumeration

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.

Creating an Enumeration

To create a new Enumeration:

  1. Select the Enumeration tool from the toolbox

  2. Click on the canvas where you want to place the Enumeration

Adding a Dependency

To create a Dependency between a Class and an Enumeration:

  1. Select the Dependency tool from the toolbox

  2. Click on a Class that uses the Enumeration

  3. Move above and click the Enumeration

Adding an Existing Enumeration to a Diagram

To add an existing Enumeration to a diagram:

  1. Open the diagram you want to add the Enumeration to

  2. Drag and drop the Enumeration from the navigation tree into the diagram

An Enumeration in a Dependency relationship with a Class