1.2.4 Creating a Class Diagram in Violet

Plan the Classes Before Using the Tool

Violet records the model.

It does not decide which classes or fields belong in the design.

Before opening the editor, identify:

  • the required classes;
  • the fields for each class;
  • each field's type;
  • the basic relationships required by the model.

A small soccer design might use:

Player
Team
Create the Correct Diagram Type

Open Violet and create the class-diagram type used by your course.

Do not begin from an object diagram and try to force it into a class diagram.

The two diagram types represent different information.

Add One Class at a Time

Create the first class and give it the exact class name required by the design.

For example:

Player

Then add its fields:

name : string
jerseyNumber : int
isAvailable : bool

Keep field names and types consistent with the design.

Add Related Classes

Create:

Team

with its required fields.

If the design says Player and Team are related, add the appropriate relationship connection supported by the current course notation.

The diagram should make the structural connection visible without adding future UML detail.

Arrange the Diagram for Reading

A reader should be able to identify:

  • each class;
  • each field;
  • each type;
  • the intended relationship.

Avoid crossing lines and cramped text when a simple rearrangement improves clarity.

Visual cleanliness should support meaning.

Save the Editable Violet File

Use the required filename and location.

The editable Violet file is the source diagram.

An image or screenshot may help with viewing, but it does not replace the editable file when later revision is required.

Read the Finished Model Back into Words

For example:

If the diagram tells a different story, revise the diagram.

The model should be understandable even before it is translated into C#.