Modeling software systems requires clarity. UML (Unified Modeling Language) helps structure concepts visually. However, understanding the syntax and semantics of UML classes is crucial. In this post, I explore how to define syntax and semantics of UML classes effectively in draw.io.
What is UML?
UML (Unified Modeling Language) is a standardized modeling language. It helps software engineers and business analysts visualize systems. UML consists of diagrams that describe different aspects of a system. Among these, class diagrams define object structures. They show attributes, operations, and relationships.
What is draw.io?
Draw.io is a free online diagramming tool. It supports UML diagrams, making it easy to design software models. With its drag-and-drop interface, I can quickly create, modify, and share UML class diagrams. It integrates seamlessly with cloud storage services like Google Drive and OneDrive.
Why Model UML with draw.io?
Modeling UML with draw.io is efficient. It offers various UML templates, including class diagrams. Unlike other tools, draw.io is free and does not require installation. It allows customization, ensuring that models align with standard conventions. That is why I prefer using it for UML diagrams.
UML Class Syntax and Semantics with draw.io
Syntax and semantics define the attributes of a UML class. The attributes reside within the class scope. The following elements define them:
Allowed Components
The UML class attributes follow this structure:

[/] Name [: type] [multiplicity] [= default]
- Name: This is the attribute’s name. It is mandatory.
- Data Type: Specifies the type of the attribute. This is optional.
- Default: Sets a default value for new objects.
- Multiplicity: Defines if an attribute can have multiple values. For example, a person may have multiple first names.
- Derived: A leading / shows that the value is derived. For example, age can be derived from the birthdate.
These attributes define the properties relevant to the system under development.
Mapping UML Class Syntax in draw.io
To implement this syntax in draw.io, I use the Class 3 template from the UML templates. Other UML templates exist, but I choose this one because it aligns with IREB (International Requirements Engineering Board) standards.
Step-by-Step Guide
1. Step: Select the Class 3 template and click on it.


2. Step: Edit the Class Name
I click in the top bar and rename the class to “Car.”

3. Step: Define Attributes
For this example, I define the model name of a car:
- Name: Model name
- Data Type: String
- Default: <<model>>
- Multiplicity: [1] (A car must have exactly one model name)
Just click in the bottom bar and type what you want.

Final Thoughts
Understanding how to model syntax and semantics of UML classes in draw.io is essential for precise system modeling. Draw.io simplifies the process with ready-to-use templates. By following these steps, I ensure that my UML diagrams remain structured and clear. If you are working on software models, try draw.io to create accurate UML class diagrams with minimal effort.
This text is based on content from the source: International Requirements Engineering Board (ireb.org). The International Requirements Engineering Board is the owner of the copyright.