UML Diagram

6 Min. Read
Jun 25, 2021

Basic Building Block of UML diagram

  • Things
  • Relationship
  • Diagrams


It is of four types:

  1. Structural Things (It represent Static part of UML Diagram)

  2. Behavioral Things (It represent Dynamic part of UML Diagram)

  3. Grouping Things (It represent Organizatioaal part of UML Diagram)

  4. Annotational Things (It represent Explanatory part of UML Diagram)

Structural Things

Structural things are all about the physical part of a system. It is the noun of a UML model, such as a class, object, interface, collaboration, use case, component, and a node. Structural Things are further divided into 7 types:

  1. Class - A class in UML is very much like a class in C++. It has got defined attributes and methods as shown in figure :

  2. Interface - A collection of functions that specify a service of a class or component, i.e. externally visible behavior of that class.

  3. Collaboration - A larger pattern of behaviors and actions. Example: All classes and behaviors that create the modeling of a moving tank in a simulation.

  4. Use Case - A sequence of actions that a system performs that yields an observable result. Used to structure behavior in a model. Is realized by a collaboration.

  5. Active Class - Like a class but its represents behavior that runs concurrent with other behaviors, i.e. threading.

  6. Component - A physical and replaceable part of a system that implements a number of interfaces. Example: a set of classes, interfaces, and collaborations.

  7. Node - A physical element existing at run time and represents a resource.

Behavioral Things

Two Types of Behavioral Things 1. Interaction - A behavior made up of a set of messages exchanged among a set of objects in a particular context to accomplish a specific purpose.

  1. State Machine - A behavior that specifies the sequences of states an object or interaction goes through during its’ lifetime in response to events.

Grouping Things

One Type of Grouping Thing

  1. Package - A general purpose mechanism for organizing elements into groups.

Annotational Things

One Type of Annotation Thing

  1. Note - A symbol to display comments.


  1. Dependency – A semantic relationship in which a change on one thing (the independent thing) may cause changes in the other thing (the dependent thing).

  2. Association – A structural relationship describing links between objects. May also include labels to indicate number and role of the links. In the example shown below there may be any number of employees (*) each of which has 0 or 1 employer.

  3. Generalization – A specialization/generalization relationship. Simply put this describes the relationship of a parent class (generalization) to its subclasses (specializations).

  4. Realization – Defines a relationship in which one class specifies something that another class will perform. Example: The relationship between an interface and the class that realizes or executes that interface.


– UML Diagram types

Structure diagrams depict the static structure of the elements in your system. i.e., how one object relates to another. It shows the things in the system – classes, objects, packages or modules, physical nodes, components, and interfaces. For example, just as the static aspects of a house encompass the existence and placement of such things as walls, doors, windows, pipes, wires, and vents. The Seven UML structural diagrams are roughly organized around the major groups of things you’ll find when modeling a system. Since structure diagrams represent the structure, they are used extensively in documenting the software architecture of software systems.

Behavioral Diagrams UML’s five behavioral diagrams are used to visualize, specify, construct, and document the dynamic aspects of a system. It shows how the system behaves and interacts with itself and other entities (users, other systems). They show how data moves through the system, how objects communicate with each other, how the passage of time affects the system, or what events cause the system to change internal states. Since behavior diagrams illustrate the behavior of a system, they are used extensively to describe the functionality of software systems. As an example, the activity diagram describes the business and operational step-by-step activities of the components in a system.

In other words, a behavioral diagram shows how the system works ‘in motion’, that is how the system interacts with external entities and users, how it responds to input or event and what constraints it operates under.

Class Diagram

– A set of classes, interfaces, and collaborations and their relationships. Most often found in modeling Object Oriented systems. (See the examples below.)

Class diagrams are the main building block of any object-oriented solution. It shows the classes in a system, attributes, and operations of each class and the relationship between each class.

In most modeling tools, a class has three parts. Name at the top, attributes in the middle and operations or methods at the bottom. In a large system with many related classes, classes are grouped together to create class diagrams. Different relationships between classes are shown by different types of arrows.

Below is an image of a class diagram. Follow the link below for more class diagram examples or get started instantly with our class diagram templates.

Object Diagram

– A set of objects and their relationships. Represents static instances of things found in class diagrams. (See the examples below.)

Object Diagrams, sometimes referred to as Instance diagrams are very similar to class diagrams. Like class diagrams, they also show the relationship between objects but they use real-world examples.

They show how a system will look like at a given time. Because there is data available in the objects, they are used to explain complex relationships between objects.

Use Case Diagram

– A set of Use Cases and actors. (See the examples below.)

As the most known diagram type of the behavioral UML types, Use case diagrams give a graphic overview of the actors involved in a system, different functions needed by those actors and how these different functions interact.

It’s a great starting point for any project discussion because you can easily identify the main actors involved and the main processes of the system. You can create use case diagrams using our tool and/or get started instantly using our use case templates.

Use Case Diagram Relationships Explained with examples

Sequence Diagram

– An interactive diagram (set of objects, relationships, and messages that may be exchanged) emphasizing the time-ordering of messages. (See the examples below.) Sequence diagrams in UML show how objects interact with each other and the order those interactions occur. It’s important to note that they show the interactions for a particular scenario. The processes are represented vertically and interactions are shown as arrows. This article explains the purpose and the basics of Sequence diagrams. Also, check out this complete Sequence Diagram Tutorial to learn more about sequence diagrams.

Here is one of the example of sequence diagram .

Collaboration Diagram

– An interaction diagram emphasizes the structural organization of the objects that send and receive messages. (See the examples below.) In UML 1 they were called collaboration diagrams. Communication diagrams are similar to sequence diagrams, but the focus is on messages passed between objects. The same information can be represented using a sequence diagram and different objects. Click here to understand the differences using an example. Statechart Diagram – Shows a state machine with states, transitions, events, and activities. (See the examples below.)

Activity Diagram

– Special type of statechart diagram that shows the flow from activity to activity within a system. (See the examples below.) Activity diagrams represent workflows in a graphical way. They can be used to describe the business workflow or the operational workflow of any component in a system. Sometimes activity diagrams are used as an alternative to State machine diagrams. Check out this wiki article to learn about symbols and usage of activity diagrams. You can also refer this easy guide to activity diagrams.

Component Diagram

– Shows the organizations and dependencies among a set of components. (See the examples below.) A component diagram displays the structural relationship of components of a software system. These are mostly used when working with complex systems with many components. Components communicate with each other using interfaces. The interfaces are linked using connectors. The image below shows a component diagram.

Deployment Diagram

– Shows the configuration of run-time processing nodes and the components that are part of them. (See the examples below.) A deployment diagram shows the hardware of your system and the software in that hardware. Deployment diagrams are useful when your software solution is deployed across multiple machines with each having a unique configuration. Below is an example deployment diagram.

Thank you.

Any Question?