Intro to UML 2.5 diagram types and templates
Brandi Gratis
December 15, 2021
An architect wouldn’t start building a skyscraper without a blueprint. Similarly, a developer wouldn’t code an application without a structured idea of what to create. Why? Because an application can only function if it’s structured to allow scalability, security, and execution.
Mapping out a plan is the first step to any project. Likewise, modeling is an essential part of any software project, large or small. Using the UML diagrams — Unified Modeling Language — available in Cacoo, you can specify, visualize, and document various software development projects.
What types of UML diagrams are there?
As of UML 2.5, there are 14 types of UML diagrams. However, the two main categories include structure and behavior diagrams.
A structure UML diagram shows the static parts of a system and how they relate to each other. Each element represents a particular concept and may include abstract, real-world, and implementation factors. Structure diagrams include class diagrams, object diagrams, package diagrams, composite structure diagrams, component diagrams, deployment diagrams, and profile diagrams.
A behavior UML diagram shows the dynamic behavior of all objects in a system, including changes to the system over time. Behavior diagrams include use case diagrams, activity diagrams, state machine diagrams, and interaction diagrams.
Interaction diagrams are a subset of behavior diagrams, which include sequence diagrams, communication diagrams, timing diagrams, and interaction overview diagrams.
Structural vs. behavioral diagrams: when to use them
When choosing between structure and behavior diagrams, think about the type of relationship you want to represent. What information do you want to convey to someone who views your illustration?
When to use structure UML
Structure diagrams help to visualize the framework of a system. Because this type of model focuses on fixed relationships or attributes, it doesn’t show functionality.
In other words, the components of a structural diagram stay the same unless you redesign the system. Beyond software development, you can apply this diagram to various business models. Use structural UML to depict process flows without regard to functionality. Examples include:
- A folder hierarchy in a software program
- A process map for manufacturing a product
- The architecture of a point-of-sale system
- The map of the blogging process from writing to publication
- A list of zoo enclosures, animals, and handlers assigned to them
When to use behavior UML
In contrast, behavioral diagrams are all about functionality. They often show how a task changes along a system path or outcomes based on different interactions. Behavior models help illustrate command sequences, activities, and conditional relationships. Examples include:
- An inventory management software model
- A booking process that verifies availability
- An ATM transaction that requires a sequence of steps
- A login system with reset, authenticator, lockout, and CAPTCHA prompts
- An automated email marketing campaign
UML diagrams to try out in Cacoo
You can use our class diagram template to create either class diagrams or object diagrams, as they use similar graphics. Choose a class diagram to give an overview of your system’s structure depicted as a collection of static elements. Or create an object diagram to drill down on a more instance-specific level. Then, you can give a snapshot of your system’s structure at a specific point of operation.
Try our package diagram template to show how individual package elements depend on one another.
Try out our use case diagram template to depict how users interact with a system. This diagram demonstrates functionality to show what happens when a user takes a particular action.
Activity diagrams are basically advanced flowcharts. Use them to illustrate your workflow as a sequence of activities and actions in a system.
Our state machine diagram template can help you model system behavior over several transitions. That way, designers can see the singular ‘state’ of the system at any given point based on external stimuli.
Sequence diagrams demonstrate how distinct processes operate in conjunction over time. Use our sequence diagram template to map out the exchange of messages between subsystems, such as a computer and server.
UML diagram templates for streamlined software development
Don’t feel bound by any particular template. Each one is customizable to your liking. And every shape you see is available in the Cacoo editor for creating and personalizing your own amazing UML diagram. Use our templates as a starting point or make your own from scratch.
Your diagram can be as complex or simple as you’d like. The only limit is your imagination!
Note: Access every template we mentioned, plus more, by opening your Cacoo editor and choosing the “Select and insert the template” button from the top menu. Expand the UML file of templates, and pick one to get started.
Final thoughts
The inherent flexibility of using UML diagrams means you can model just about any application, regardless of the hardware, operating system, programming language, or network.
What is your favorite UML diagram to use when starting a new software project? Let us know on Twitter!
This post was originally published on January 13, 2017, and updated most recently on December 15, 2021.