Class Diagrams
Class diagrams are the most common type of UML diagram, used to model the static structure of a system by showing classes, their attributes, operations, and relationships.
Creating Classes
Using the Class Tool
Press A or C to activate the Class tool, then click anywhere on the canvas to place a new class box.

Class Box Structure
A UML class box consists of three compartments:
- Name compartment - Contains the class name and optional stereotype
- Attributes compartment - Lists the class properties/fields
- Operations compartment - Lists the class methods/functions

Class Properties
Select a class and use the Inspector panel to configure its properties:
Name
The class name appears in bold in the top compartment. Convention uses PascalCase (e.g., CustomerOrder).
Stereotype
Optional classifier that appears above the class name in guillemets:
<<interface>>- For interface definitions<<abstract>>- For abstract classes<<enumeration>>- For enum types<<entity>>- For domain entities- Custom stereotypes are also supported
Abstract
Toggle to render the class name in italics, indicating an abstract class.

Attributes
Attributes represent the data/properties of a class.
Adding Attributes
- Select the class
- In the Inspector, find the Attributes section
- Click the
+button to add a new attribute - Enter the attribute details
Attribute Syntax
Attributes follow this format: visibility name : type
Visibility Modifiers:
| Symbol | Meaning | Description |
|---|---|---|
+ | Public | Accessible from anywhere |
- | Private | Accessible only within the class |
# | Protected | Accessible within class and subclasses |
~ | Package | Accessible within the same package |
Examples:
-id: Int- Private integer ID+name: String- Public string name#createdAt: Date- Protected date field~cache: Map<String, Any>- Package-private cache
Operations
Operations represent the behavior/methods of a class.
Adding Operations
- Select the class
- In the Inspector, find the Operations section
- Click the
+button to add a new operation - Enter the operation details
Operation Syntax
Operations follow this format: visibility name(parameters) : returnType
Examples:
+getName(): String- Public getter returning String-validate(input: String): Boolean- Private validation method+process(data: Data, options: Options): Result- Method with multiple parameters+save(): void- Method with no return value
Relationships
Press R to activate the Relationship tool, then drag from one class to another to create a connection.
Relationship Types
| Type | Line Style | Arrow | Use Case |
|---|---|---|---|
| Association | Solid line | Open arrow | General relationship |
| Dependency | Dashed line | Open arrow | "Uses" relationship |
| Inheritance | Solid line | Hollow triangle | "Is-a" relationship (extends) |
| Realization | Dashed line | Hollow triangle | Interface implementation |
| Aggregation | Solid line | Hollow diamond | "Has-a" (weak ownership) |
| Composition | Solid line | Filled diamond | "Has-a" (strong ownership) |

Creating Relationships
- Press
Rto activate the Relationship tool - Click on the source class
- Drag to the target class
- Release to create the connection
- Use the Inspector to change the relationship type and arrowheads
Relationship Labels
Double-click on a relationship line to add labels:
- Name - Describes the relationship (e.g., "manages", "contains")
- Multiplicity - Indicates how many instances (e.g., "1", "0..*", "1..n")
- Role names - Labels at each end describing the role
Best Practices
- Keep it simple - Don't try to model everything; focus on key classes
- Use stereotypes - Clearly mark interfaces and abstract classes
- Show key relationships - Not every association needs to be shown
- Consistent naming - Use PascalCase for classes, camelCase for members
- Group related classes - Use visual proximity to show logical groupings