Unified Modeling Language: Rwanda Coding Academy
Unified Modeling Language: Rwanda Coding Academy
AWET
Rwanda Coding Academy
February 4, 2025
1 / 39
Overview
4. 3.Behavioral
2 / 39
What is UML?
3 / 39
Types of UML diagrams
• Types of UML diagrams (Use case diagrams, class diagrams, sequence diagrams,
activity diagrams, state machine diagrams, component diagrams, deployment
diagrams, package diagrams, object diagrams, etc.)
4 / 39
Why do 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(among experts) .
5 / 39
Different Types of UML Diagrams
A. Class Diagram
• The most widely used 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 the class hierarchy of the system, its methods, and
its attributes. Class diagrams also help us identify relationships between different
classes or objects.
7 / 39
CLASS DIAGRAMS(conts..)
• A class diagram describes the static structure of a system. It shows how a system
is structured rather than how it behaves. The static structure of a system
comprises many class diagrams and their dependencies. The main constituents of a
class diagram are classes and their relationships : generalization , aggregation ,
association , and various kinds of dependencies.
8 / 39
Class
9 / 39
Attributes
10 / 39
Operations
Figure: operation
11 / 39
Association types
• They are association (the most common being bidirectional and unilateral
association), inheritance, realization/implementation, dependency, aggregation,
composition, and multiplicity.
• As mentioned above, class diagrams can represent relationships between classes.
There are seven relationships that are commonly shown in class diagrams
12 / 39
A. Association
14 / 39
C. Reflexive Association
15 / 39
D. Multiplicity
Figure: Multiplicity 16 / 39
Multiplicity
17 / 39
E: Aggregation
• Refers to the formation of a particular
class as a result of one class being • aggregation, the classes nurture the
aggregated or built as a collection. For ‘has a relationship.
example, the class “library” is made up • A part can exist independently of the
of one or more books, among other whole.
materials.
• In aggregation, the contained classes
are not strongly dependent on the
lifecycle of the container.
• In the same example, books will remain
so even when the library is dissolved.
• To show aggregation in a diagram, draw
a line from the parent class to the child
class with a diamond shape near the Figure: Aggregation
parent class. 18 / 39
F. Composition
19 / 39
G. Inheritance/Generalization
20 / 39
H. Realization
21 / 39
22 / 39
.
Structural UML Diagrams
Deployment Diagrams
• Deployment Diagrams Deployment diagrams are used to visualize the hardware
processors/ nodes/ devices of a system, the links of communication between
them and the placement of software files on that hardware.
• Deployment diagrams are commonly used to visualize physical hardware and
software of a system.
• Using it you can understand how the system will be physically deployed on the
hardware.
• Deployment diagrams help model the hardware topology of a system compared to
other UML diagram types which mostly outline the logical components of a system.
22 / 39
Structural UML Diagrams
Deployment Diagrams...
• Deployment Diagram is a type of diagram that specifies the physical hardware on
which the software system will execute.
• It also determines how the software is deployed on the underlying hardware. It maps
software pieces of a system to the device that are going to execute it.
• The deployment diagram maps the software architecture created in design to the
physical system architecture that executes it. In distributed systems, it models the
distribution of the software across the physical nodes.
23 / 39
Deployment Diagram Symbol and notations
24 / 39
What is an artifact?
Deployment Diagrams...
• An artifact represents the specification of a concrete real-world entity related to
software development. You can use the artifact to describe a framework which is
used during the software development process or an executable file. Artifacts are
deployed on the nodes. The most common artifacts are as follows,
25 / 39
Artifacts....
• Artifacts are deployed on the nodes. It can provide physical manifestation for any
UML element. Generally, they manifest components. Artifacts are labeled with the
stereotypec <<artifact>> ,and it may have an artifact icon on the top right corner.
• Each artifact has a filename in its specification that indicates the physical location of
the artifact. An artifact can contain another artifact.
• It may be dependent on one another.Artifacts have their properties and behavior that
manipulates them.
• Generally, an artifact is represented as follows in the unified modeling language.
27 / 39
What is a node?
• Node is a computational resource upon which artifacts are deployed for execution. A
node is a physical thing that can execute one or more artifacts. A node may vary in
its size depending upon the size of the project.
• Node is an essential UML element that describes the execution of code and the
communication between various entities of a system. It is denoted by a 3D box with
the node-name written inside of it. Nodes help to convey the hardware which is used
to deploy the software.
• An association between nodes represents a communication path from which
information is exchanged in any direction.
28 / 39
nodes...
• Generally, a node has two stereotypes as follows:
• << device >> It is a node that represents a physical machine capable of performing
computations. A device can be a router or a server PC. It is represented using a node
with stereotype <<device>>.In the UML model, you can also nest one or more
devices within each other. Following is a representation of a device in UML:
29 / 39
nodes...
• << execution environment >>It is a node that represents an environment in
which software is going to execute. For example, Java applications are executed
in java virtual machine (JVM). JVM is considered as an execution environment for
Java applications. We can nest an execution environment into a device node. You
can net more than one execution environments in a single device node.
• Following is a representation of an execution environment in UML
30 / 39
Example of a Deployment diagram
Following deployment diagram represents the working of HTML5 video player in the
browser:
31 / 39
Behavioral diagram:USE CASE DIAGRAM :
32 / 39
Behavioral diagram:USE CASE DIAGRAM :
• The use cases partition the system behavior into transactions, such that each
transaction performs some useful action from the user’s point of view.
• The purpose of a use case is to define a piece of coherent behavior without revealing
the internal structure of the system.
• The use cases do not mention any specific algorithm to be used or the internal data
representation, internal structure of the software, etc
• A use case typically represents a sequence of interactions between the user and the
system
33 / 39
Use case (cont..)
• In the use case diagram, each use case is represented by an ellipse with the name of
the use case written inside the ellipse .
• The All the ellipses (i.e. use cases) of a system are enclosed within a rectangle which
represents the system boundary.
• The different users of the system are represented by using the stick person icon.
• Each stick person icon is normally referred to as an actor.
• An actor is a role played by a user with respect to the system use.
• It indicates that the actor makes use of the functionality provided by the use case.
Both the human users and the external systems can be represented by stick person
icons. When a stick person icon represents an external system, it is annotated by the
stereotype ¡¡external system¿¿.
34 / 39
Example
Figure: TikTok
36 / 39
Example 2
37 / 39
Example 2
38 / 39
The End
39 / 39