A UML diagram is a diagram drawn in the Unified Modeling Language, a standard visual notation for describing the structure and behavior of software systems. UML was adopted as a standard by the Object Management Group in 1997. Because the notation is shared, a developer, an analyst and an architect can read the same diagram in the same way.
Types of UML diagrams
UML diagrams fall into two groups.
Structure diagrams show what a system is made of:
Class diagram: classes, their attributes and methods, and the relationships between them.
Component diagram: the larger parts of a system and their interfaces.
Deployment diagram: the servers and devices that software runs on.
Object and package diagrams: instances at a moment in time, and how code is grouped.
Behavior diagrams show what a system does:
Use case diagram: the goals users can reach with the system.
Activity diagram: a workflow of steps and decisions, similar to a flowchart.
Sequence diagram: messages between participants in time order.
State machine diagram: the states of an object and what moves it from one to another.
When to use a UML diagram
Before building: to agree on a design and find problems while they are cheap to fix.
While building: to explain one part of the system to a teammate.
After building: to document how the system works for new team members.
Most teams use a few diagram types, usually class, sequence, activity and use case, and draw them only where a picture is clearer than text.
How to create a UML diagram
Decide the question. "How do these services talk?" suggests a sequence diagram. "What data does an order hold?" suggests a class diagram.
Set the level of detail. A sketch for a discussion needs less than a specification.
Draw the main elements first, then add relationships, labels and multiplicities.
Review it with the people who will build from it, and update it when the design changes.
Example
Lucas designs a booking system for a dental practice. A use case diagram lists what patients and receptionists can do. A class diagram defines Patient, Appointment and Dentist. A sequence diagram shows how an online booking checks availability and sends a confirmation.
UML diagram vs other diagrams
UML is general purpose. An ER diagram is specific to database design, and the C4 model is a simpler set of architecture diagrams for explaining a system at several levels of zoom.
UML diagrams in MockFlow
Describe what you need and UML diagram with AI drafts it on a MockFlow board, ready to edit with your team. The UML diagram tool page shows the shapes available, and templates such as the UML sequence diagram and UML deployment diagram give a starting point. See also the whiteboard for developers.
