Back to Basics: What is a UML diagram? | HackMD Blog
May 21, 2024

Back to Basics: What is a UML diagram?

Rachel Golden
Rachel Golden
Telling HackMD's story, building awareness, and meaningfully connecting with communities.

A Unified Modeling Language diagram – or UML diagram – acts as a visual representation of systems and software. This visualization helps everything from onboarding new collaborators to giving a quick overview of structures to digging into the technical components of a new product.

Because when it comes to technical documentation, the writing can sometimes be complicated. UML diagrams visualize and simplify information in a way that’s easier to digest.

There are a ton of diagrams available depending on your need, each serving a unique purpose. And because of that, they have become an indispensable tool for software developers, analysts, writers, and many others documenting online.

So in today’s Back to Basics series, we’re diving into the different types of UML diagrams, exploring their uses and characteristics.

Types of UML diagrams

There are two main types of UML diagrams: structural and behavioral.

Structural diagrams

As you might have guessed, structural diagrams show how a system is structured, including all of its components, and the static relationships between those components.

The main types of structural diagrams are:

  • Class
  • Package
  • Component
  • Deployment
  • Composite structure

Class diagram Class diagrams are the keystones of the UML diagrams and the most common type of UML diagram. They depict the static structure of a system by illustrating classes, their attributes, methods, and relationships.

They provide the blueprint of a system’s object-oriented design, showcasing the building blocks of the software solution itself.

Package diagram Package diagrams organize and structure the elements of a system into cohesive packages or namespaces, highlighting the different dependencies and relationships within a system. They help manage system complexity and modularization, providing a hierarchical view of the system architecture.

Simply put, package diagrams allow you to group items into folders. Once all items are added to folders. they can be ranked hierarchically.

Component diagram Component diagrams break down complex systems into smaller parts, illustrate the physical objects (or components) of a system and their dependencies. They’re essentially more specialized versions of class diagrams. They help in understanding the modular structure of the system, the relationships between its components, and how they’re wired together.

Deployment diagram Deployment diagrams depict the deployment of software components onto hardware nodes. They show how software artifacts are distributed across hardware infrastructure, aiding in system deployment and configuration.

You would most likely use this diagram to keep track of your entire hardware mesh and how that affects performance, scalability, maintainability, and portability. This diagram allows you to ensure all elements are accounted for ahead of deployment.

Composite structure diagram Composite structure diagrams visualize the inner workings of a hardware system, specifically the behaviors and interactions between components.

Behavioral diagrams

Behavioral diagrams, on the other hand, visualize how the system behaves and interacts with itself, users, and other systems.

The main types of behavioral diagrams are:

  • Timing
  • Activity
  • Use case
  • Sequence
  • State machine
  • Communication

Timing diagrams Timing diagrams visualize the behavior and interaction of different objects within a specified timeframe. They’re particularly well-suited for product launches, as you can see how long each step within the process takes and improve from there.

Activity diagrams As it sounds, activity diagrams model the flow (or steps) of activities or processes within a system, depicting sequential and parallel behavior. They are useful for visualizing business processes, algorithmic workflows, or system behavior at a high level of abstraction.

Activity diagrams are typically visualized as flowcharts, detailing everything from start to finish and the various decision paths.

Use case diagrams Use case diagrams focus on the functional requirements of a system by representing interactions between actors and use cases. Think of it as a high-level overview of the relationship beween a system (or product) and the end-user.

These diagrams visualize how it reacts under different circumstances and aid in identifying and defining system functionalities from the perspective of end users or external systems.

Sequence diagrams Sequence diagrams – or event diagrams – capture the dynamic behavior of a system by showing interactions between objects over time. Simply put, they visualize the order in which objects interact with one another. They also depict the flow of messages exchanged among objects, helping to understand system behavior during runtime.

This visualization helps builders understand how to structure a new system or improve an existing one.

State machine diagrams State machine diagrams – or state chart diagrams – visualize how elements act differently depending on the state of the program being developed and the transitions it could take. It visualizes potential flow combinations.

Communication diagrams Communication diagrams – or collaboration diagrams – are similar to sequence diagrams in the fact that they depict messages passed between different objects in a system. However, while sequence diagrams focus on processes over time, communication diagrams focus on a complete, big-picture map of a product.

Building UML diagrams

UML diagrams are invaluable assets in the arsenal of software professionals, empowering them to model, design, and communicate software systems effectively. Within HackMD, there are many tools to help you build a UML diagram.

Specifically, all of the below can be created directly in your documentation to visualize different UML diagrams and graphs:

  • ABC
  • Mermaid
  • Graphviz
  • Pie chart
  • Flowchart
  • Gantt chart
  • Sequence diagrams

By leveraging these tools and techniques, you can create a diverse range of UML diagrams tailored to their specific needs, whether it be modeling system behavior, visualizing project schedules, or analyzing cost structures.

Each tool offers unique features and capabilities, empowering users to express complex ideas and concepts through intuitive visual representations.

Create your UML diagrams today in HackMD.