Chapter Two
Unified Modeling Language
(UML)
BY: S E N B E T U A .
D E C, 2 0 2 2
J KU, J I N KA , E T H I O P I A
12/22/2024 1
What are models?
• System development is model building
• Complexity of a large project: A large number of components & A
large amount of team work
• Linguistic communication between teams or between team
members is neither accurate nor reliable
• Models are standard representations and they are accurate and
reliable
• Modelling is the process of developing a model
• Various types of models for different purposes and stages in
software development
12/22/2024 2
Continued…
• A complete description of a system from a particular perspective
• Simplification of reality
• Modeling achieves four aims:
Helps you to visualize a system as you want it to be.
Permits you to specify the structure or behavior of a system.
Gives you a template that guides you in constructing a system.
Documents the decisions you have made.
We build models of complex systems because we cannot understand
such a system in its entirety.
We build models to better understand the system we are developing.
12/22/2024 3
Principles of Modeling
• Four principles of modeling:
1. The choice of what models to create has a profound
influence on how a problem is attacked and how a solution is
shaped.
2. Every model may be expressed at different levels of
precision.
3. The best models are connected to reality.
4. No single model is sufficient.
Every nontrivial system is best approached through a small
set of nearly independent models. 12/22/2024 4
What is UML?
• UML is a language (Unified Modeling Language) for models
Unified:– UML combined the best from object-oriented software
modeling methodologies that were in existence during the
early times.
Modeling:– Used to present a simplified view of reality in order
to facilitate the design and implementation of object-oriented
software systems.
Language:– UML is primarily a graphical language that follows
a precise syntax.
12/22/2024 5
What is the UML?
• The UML offers a standard way to write a system's blueprints,
including conceptual things such as business processes and
system functions as well as concrete things such as
programming language statements, database schemas, and
reusable software components."
• The Unified Modelling Language (UML) is an industry standard
for object oriented design notation, supported by the Object
Management Group (OMG).
• UML is a graphical language for visualizing, specifying,
constructing, and documenting the artifacts of a software -
intensive system.
12/22/2024 6
UML: Language for Visualizing
• Communicating conceptual models to others is prone to error
unless everyone involved speaks the same language.
• There are things about a software system you can’t understand
you build models.
• An explicit model facilitates communication.
12/22/2024 7
UML: Language for Specifying
• The UML builds models that are precise, unambiguous, and
complete.
12/22/2024 8
UML: Language for Constructing
UML models can be directly connected to a variety of
object-oriented programming languages.
• Maps to Java, C++, Visual Basic, Python and so on
• Tables in a RDBMS or persistent store in an OODBMS
Permits forward engineering
Permits reverse engineering
12/22/2024 9
UML: Language for Documenting
12/22/2024 10
Building Blocks of the UML:
• The vocabulary of the UML encompasses three kinds of building
blocks:
1. Things : - There are four kinds of things in the UML: -
Structural things
Behavioral things
Grouping things
Annotational things
2. Relationships: dependency, association, generalization and
realization.
3. Diagrams: class, object, use case, sequence, collaboration, state
12/22/2024 11
Things in the UML: Structural Things
• Structural things are the nouns of UML models.
• These are the mostly static parts of a model, representing
elements that are either conceptual or physical.
• In all, there are seven kinds of structural things.
1. Classes: a class is a description of a set of objects that share
the same attributes, operations, relationships, and semanics.
2. Interface: an interface is a collection of operations that
specify a service of a class or component.
3. Collaborations: a collaboration defines an interaction
12/22/2024 12
Continued…
4. Use Cases: a use case is realized by a collaboration.
5. Active Classes: an active class is rendered just like a class,
but with heavy lines, usually including its name, attributes, and
operations.
6. Components: A component typically represents the physical
packaging of logical elements, such as classes, interfaces, and
collaborations.
7. Nodes: a node is a physical element that exists at run time
and represents a computational resource
12/22/2024 13
Things in the UML: Behavioral Things
• Behavioral things are the dynamic parts of UML models.
• These are the verbs of a model, representing behavior over time and
space.
• In all, there are two primary kinds of behavioral things.
1. Messages: an interaction is a behavior that comprises a set of
messages exchanged among a set of objects within a particular
context to accomplish a specific purpose.
Graphically, a message is rendered as a directed line, almost always
including the name of its operation.
2. States: a state machine is a behavior that specifies the sequences
of states an object or an interaction goes through during its lifetime in
12/22/2024 14
Things in the UML: Grouping Things
• Grouping things are the organizational parts of UML models.
• These are the boxes into which a model can be decomposed.
• In all, there is one primary kind of grouping thing, namely,
packages.
• Packages: A package is a general-purpose mechanism for
organizing elements into groups.
Graphically, a package is rendered as a tabbed folder, usually
including only its name and, sometimes, its contents.
Figure:
Packages
12/22/2024 15
Things in the UML: Annotational Things
• Annotational things are the explanatory parts of UML models.
• These are the comments you may apply to describe,
illuminate, and remark about any element in a model.
• There is one primary kind of annotation thing, called a note.
• A note is simply a symbol for rendering constraints and
comments attached to an element or a collection of
elements.
• Figure: Notes
12/22/2024 16
Relationships in UML
12/22/2024 17
Diagrams in the UML
• Diagrams graphically depict a view of a part of your
model.
• Different diagrams represent different views of the
system that you are developing.
• A model element will appear on one or more
diagrams.
• Common UML Diagrams: class, object, use case,
sequence, collaboration, state chart, activity,
component and deployment.
12/22/2024 18
What is a Use-Case Model?
• A use-case model: is a model of a system’s environment
• Serves as a contract between the customer and the
developers
• Contains the following diagrams:
Use case: Shows a set of use cases and actors and their
relationships
Activity: Shows the flow of events within a use case
Sequence: Shows how a use case will be implemented
in terms of collaborating objects
12/22/2024 19
Use Case Diagram
Elements
– Actors
– Use cases
– Relations
• Use case diagram
shows relationship
between actors and
use cases
12/22/2024 20
Class Diagram
Class Diagram – set of classes and their relationships.
Describes interface to the class (set of operations describing
services)
Class diagrams show the static structure of the model
responsibility system: Classes, Attributes and Relationships to other
classes
Class diagrams do not show temporal information: INSPIRE data
specifications
Describe classes – In the OO sense
Class diagrams are static -- they display what interacts but not
12/22/2024 21
Continued…
• Example of class diagram
12/22/2024 22
Object Diagram
• Object diagram is an instantiation of a class diagram
• Represents a static structure of a system at a particular time
12/22/2024 23
Sequence Diagrams
Sequence diagrams
– Refine use cases
– Gives view of dynamic behavior of classes
• Class diagrams give the static class structure
Not orthogonal to other diagrams
– Overlapping functionality
– True of all UML diagrams
used to show how objects interact to perform the behavior of all
or part of a use case as part of a use-case realization
12/22/2024 24
Example of Sequence Diagram
12/22/2024 25
Collaboration Diagram
Collaboration Diagram – focus on
structural organization of objects and
messages
Collaboration diagram- provide
another way to show how objects
interact to perform the behavior of a
particular use case or a part of a use
case.
Where sequence diagrams emphasize
the interactions of objects over time,
communication diagrams are designed 12/22/2024 26
State Chart Diagram
State Chart Diagram – event driven state changes of system
A state machine is a behavior that specifies the sequences of
states an object goes through during its lifetime in response to
events, together with its responses to those events.
A state is a condition or situation during the life of an object
during which it satisfies some condition, performs some activity,
or waits for some event.
12/22/2024 27
Activity Diagrams
• An activity diagram
shows the flow from
activity to activity.
• Is an ongoing nonatomic
execution within a state
machine.
• Contents
Activity states and action
states
Transitions
12/22/2024 28
Component Diagram
It shows the runtime structure of the system at the level of
software components.
Components are the modular parts of the system and are made
up of groups of related objects that are hidden behind an external
interface.
12/22/2024 29
Deployment Diagram
Deployment diagrams show
the deployment architecture of
the system, that is, which of
the artifacts reside on which
pieces of hardware.
A node is a physical element
that exists at run time and
represents a computational
resource, generally having at
least some memory and, often,
processing capability.
Graphically, a node is rendered
12/22/2024 30
End of Chapter
Thank You!
12/22/2024 31