# UML Diagram types

In 
Published 2022-12-03

This tutorial explains to you which are the main UML diagram types. You will have a short explanation of each UML diagram type.

The types of diagrams we can create using UML are organized into two distinct groups structural diagrams and behavioral or interaction diagrams.

# Structural UML diagrams

Class UML diagram

The Class Diagram provides an overview of the system by describing the objects (using classes) inside the system and the relationships between them. It provides a wide variety of usages; from modeling the domain-specific data structure to detailed design of the target system. The class UML diagram is a static diagram.

Object UML diagram

Object diagrams represent an instance of a class diagram (object diagram is based on the class diagram).

Package UML diagram

The package UML diagram in depicts the dependencies between the packages that make up a model. Package is a namespace used to group together elements that are semantically related and might change together. It is a general purpose mechanism to organize elements into groups to provide better structure for system model. Because package is a namespace, elements of related or the same type should have unique names within the enclosing package. Different types of elements are allowed to have the same name. A package is a container for the definitions of UML elements such as classes, use cases, actors and components. A package can also contain other packages.

Deployment UML diagram

A deployment UML diagram models the run-time architecture of a system. It shows the configuration of the hardware elements (nodes) and shows how software elements are mapped onto those nodes (hardware elements).

Component UML diagram

The component UML diagram depicts how components are wired together to form larger components or software systems. It does not describe the functionality of the system, but it describes the components used to make those functionalities.

Composite structure UML diagram

A composite structure is a set of interconnected elements that collaborate at runtime to achieve some purpose. Each element has some defined role in the collaboration. In this diagram you can see how each element (part) is interconnected to others. This diagram can include internal parts, ports (through which the parts interact with each other), connectors between parts or ports.

# Behavioral (interaction) UML diagrams

Use case UML diagram

The Use case UML diagram shows how the users interact with the system (application, etc). A use case diagram can identify the different types of users of a system and the different use cases and will often be accompanied by other types of diagrams as well.

Sequence UML diagram

The Sequence UML Diagram models the collaboration of objects based on a time sequence. You can see the order of messages/ actions between two (or more) participants. Participants do not have to be explicitly declared. For this diagram you can use an arrow, a dotted arrow or an arrow like this "----->". That does not change the diagram, but may improve readability. UML sequence diagrams are used to show how objects interact in a given situation.

Activity UML diagram

The activity diagram is used to display the sequence of activities. Activity diagrams are as simple to make as an ordinary flowchart. The activity UML diagram are not exactly a flow chart as they have some additional capabilities. These additional capabilities include branching, parallel flow, etc.

State UML diagram

The State UML diagram defines different states of an object during its lifetime. These states are changed by events. This UML diagram models the dynamic flow of control from state to state of a particular object within a system.

Communication UML diagram

Communication diagram (collaboration diagram in UML 1) is similar to sequence diagrams, but the focus is on messages passed between objects.

Interaction overview UML diagram

The Interaction overview UML diagrams are very similar to activity UML diagrams. While activity diagrams show a sequence of processes, Interaction overview diagrams show a sequence of interaction diagrams. The interaction overview diagram is similar to the activity diagram, in that both visualize a sequence of activities. The difference is that, for an interaction overview, each individual activity is pictured as a frame which can contain a nested interaction diagram.

Timing UML diagram

The timing UML diagram is a special form of a sequence diagram. The differences between timing diagram and sequence diagram are the axes are reversed so that the time is increased from left to right and the lifelines are shown in separate compartments arranged vertically.