UML Diagrams
UML Diagrams
What is UML?
Unified Modeling Language (UML) is a standardized visual modeling language that is a
versatile, flexible, and user-friendly method for visualizing a system’s design. Software system
artifacts can be specified, visualized, built, and documented with the use of UML.
We use UML diagrams to show the behavior and structure of a system.
UML helps software engineers, businessmen, and system architects with modeling, design,
and analysis.
Why do we need UML?
We need UML (Unified Modeling Language) to visually represent and communicate complex
system designs, facilitating better understanding and collaboration among stakeholders. Below
is why we need UML:
Complex applications need collaboration and planning from multiple teams and hence require
a clear and concise way to communicate amongst them.
Businessmen do not understand code. So UML becomes essential to communicate with non-
programmers about essential requirements, functionalities, and processes of the system.
A lot of time is saved down the line when teams can visualize processes, user interactions, and
the static structure of the system.
Types of UML Diagrams
UML is linked with object-oriented design and analysis. UML makes use of elements and forms
associations between them to form diagrams. Diagrams in UML can be broadly classified as:
Structural UML Diagrams
Structural UML diagrams are visual representations that depict the static aspects of a system,
including its classes, objects, components, and their relationships, providing a clear view of the
system’s architecture. Structural UML diagrams include the following types:
1. Class Diagram
The most widely use UML diagram is the class diagram. It is the building block of all object
oriented software systems. We use class diagrams to depict the static structure of a system by
showing system’s classes, their methods and attributes. Class diagrams also help us identify
relationship between different classes or objects.
A composite structure diagram represents relationship between parts and their configuration
which determine how the classifier (class, a component, or a deployment node) behaves.
They represent internal structure of a structured classifier making the use of parts, ports, and
connectors.
We can also model collaborations using composite structure diagrams. They are similar to class
diagrams except they represent individual parts in detail as compared to the entire class.
3. Object Diagram
An Object Diagram can be referred to as a screenshot of the instances in a system and the
relationship that exists between them. Since object diagrams depict behaviour when objects have
been instantiated, we are able to study the behaviour of the system at a particular instant.
An object diagram is similar to a class diagram except it shows the instances of classes in
the system.
We depict actual classifiers and their relationships making the use of class diagrams.
On the other hand, an Object Diagram represents specific instances of classes and
relationships between them at a point of time.
Object Diagram
Deployement Diagram
6. Package Diagram
We use Package Diagrams to depict how packages and their elements have been organized. A
package diagram simply shows us the dependencies between different packages and internal
composition of packages.
Packages help us to organise UML diagrams into meaningful groups and make the diagram
easy to understand.
They are primarily used to organise class and use case diagrams.
Package Diagram
5. Behavioral UML Diagrams
Behavioral UML diagrams are visual representations that depict the dynamic aspects of a
system, illustrating how objects interact and behave over time in response to events.
7. State Machine Diagrams
A state diagram is used to represent the condition of the system or part of the system at finite
instances of time. It’s a behavioral diagram and it represents the behavior using finite state
transitions.
State diagrams are also referred to as State machines and State-chart Diagrams
These terms are often used interchangeably. So simply, a state diagram is used to model the
dynamic behavior of a class in response to time and changing external stimuli.
8 Activity Diagrams
We use Activity Diagrams to illustrate the flow of control in a system. We can also use an
activity diagram to refer to the steps involved in the execution of a use case.
We model sequential and concurrent activities using activity diagrams. So, we basically
depict workflows visually using an activity diagram.
An activity diagram focuses on condition of flow and the sequence in which it happens.
We describe or depict what causes a particular event using an activity diagram.
Activity Diagram
9 Sequence Diagram
A sequence diagram simply depicts interaction between objects in a sequential order i.e. the
order in which these interactions take place.
We can also use the terms event diagrams or event scenarios to refer to a sequence
diagram.
Sequence diagrams describe how and in what order the objects in a system function.
These diagrams are widely used by businessmen and software developers to document and
understand requirements for new and existing systems.
Sequence Diagram