Visio UML Class Diagram Example

Steven Jul 09, 2026

Microsoft Visio is a powerful tool for creating diagrams, flowcharts, and other visual aids. One of the most common uses of Visio is to create UML (Unified Modeling Language) class diagrams. UML class diagrams are used in software engineering to visualize the structure of a system by showing the system's classes, their attributes, and the relationships between them. In this article, we will provide an example of a UML class diagram created in Visio, along with a step-by-step guide on how to create it.

UML - Class Diagram
UML - Class Diagram

Before we dive into the example, let's briefly discuss what a UML class diagram is and why it's important. A UML class diagram is a static model that describes the system's classes and their relationships. It helps software developers understand the system's structure, identify potential design issues, and communicate the system's design to others. Now, let's get started with our example.

Library domain model UML class diagram example describes main library classes and relationships.
Library domain model UML class diagram example describes main library classes and relationships.

Creating a UML Class Diagram in Visio

To create a UML class diagram in Visio, you'll first need to open Visio and select the "UML Class Diagrams" template. This template provides a set of pre-built UML shapes that you can use to create your diagram.

UML Class Diagram
UML Class Diagram

Once you have the template open, you can start adding classes to your diagram. To do this, simply drag and drop the "Class" shape onto the drawing page. You can then rename the class by double-clicking on the shape and entering the class name.

Adding Attributes and Operations

UML Class Diagram for User Login
UML Class Diagram for User Login

After adding a class to your diagram, you can add attributes and operations to it. To do this, right-click on the class shape and select "Add Attribute" or "Add Operation" from the context menu. You can then enter the attribute or operation name and data type.

For example, let's say we're creating a class diagram for a simple library system. We might create a "Book" class with attributes like "title" (string), "author" (string), and "isbn" (string), and operations like "checkOut" (void) and "return" (void).

Creating Relationships Between Classes

UML Class Diagram Overview (UML Class Diagram)
UML Class Diagram Overview (UML Class Diagram)

Once you have your classes set up with their attributes and operations, you can start creating relationships between them. The most common types of relationships in a UML class diagram are association, aggregation, and composition.

For our library system example, we might create an association relationship between the "Book" class and a "Patron" class. This would represent the fact that a book can be checked out by a patron, and a patron can check out multiple books.

Adding More Complexity to Your Diagram

online education class diagram | Creately
online education class diagram | Creately

As your system becomes more complex, you'll need to add more classes and relationships to your diagram. You can also use inheritance to model hierarchical relationships between classes.

For example, you might create a "FictionBook" class that inherits from the "Book" class. This would allow you to add attributes and operations specific to fiction books, while still inheriting the common attributes and operations from the "Book" class.

UML Class Diagram Example
UML Class Diagram Example
UML Class Diagram Tutorial
UML Class Diagram Tutorial
UML Class Diagram Template
UML Class Diagram Template
Simple UML Class | Free Simple UML Class Templates
Simple UML Class | Free Simple UML Class Templates
Copy of Online Shopping System - Class Diagram | Creately
Copy of Online Shopping System - Class Diagram | Creately
Model systems using Unified Modeling Language (UML) shapes in Visio for the web | Microsoft Community Hub
Model systems using Unified Modeling Language (UML) shapes in Visio for the web | Microsoft Community Hub
Class Diagram for Online Food Ordering System  |  UML
Class Diagram for Online Food Ordering System | UML
Relationships in UML Class Diagrams
Relationships in UML Class Diagrams
University management system – class diagram example
University management system – class diagram example
UML Class Diagram Tutorial
UML Class Diagram Tutorial
UML Class Diagram for Login System
UML Class Diagram for Login System
UML Diagrams for Home Automation System | Creately
UML Diagrams for Home Automation System | Creately
Student Registration UML Diagram | EdrawMax
Student Registration UML Diagram | EdrawMax
Types of UML Diagrams Infographic Template  Visme
Types of UML Diagrams Infographic Template Visme
UML Class Diagrams
UML Class Diagrams
UML Class Diagram
UML Class Diagram
Redirecting...
Redirecting...
UML diagrams: all 14 types explained with examples
UML diagrams: all 14 types explained with examples
UML Class Diagrams Tutorial, Step by Step
UML Class Diagrams Tutorial, Step by Step
UML Diagrams for Tour Management
UML Diagrams for Tour Management

Using Generalization and Realization

To show inheritance relationships in your diagram, you can use the "Generalization" relationship. This is represented by a hollow triangle pointing to the parent class. You can also use the "Realization" relationship to show that a class realizes an interface.

For our library system example, we might create an "ILendable" interface that defines the common behavior for all lendable items in the system. The "Book" class would then realize this interface.

Using Aggregation and Composition

In addition to association relationships, you can also use aggregation and composition to model more complex relationships between classes. Aggregation is represented by an open diamond, while composition is represented by a filled diamond.

For example, you might use composition to model the relationship between a "Library" class and a collection of "Book" objects. This would represent the fact that a library owns its books, and if the library is destroyed, its books are also destroyed.

Creating UML class diagrams in Visio can be a powerful tool for understanding and communicating the structure of your system. By following the steps outlined in this article, you can create complex and informative diagrams that will help you and your team build better software. So why wait? Start creating your UML class diagrams in Visio today!