0% found this document useful (0 votes)
35 views

Module4 - Object Oriented Analysis Dynamic Model

The document discusses dynamic modeling in object-oriented analysis and design using the Unified Modeling Language (UML). It covers use case diagrams, activity diagrams, and sequence diagrams. These diagrams can model system behavior and object interactions over time.

Uploaded by

GerardAlba
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Module4 - Object Oriented Analysis Dynamic Model

The document discusses dynamic modeling in object-oriented analysis and design using the Unified Modeling Language (UML). It covers use case diagrams, activity diagrams, and sequence diagrams. These diagrams can model system behavior and object interactions over time.

Uploaded by

GerardAlba
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Module 4: Object-Oriented Analysis – Dynamic Model

Software Engineering
Computer Science
Academic Year 2023/2024

Gerard Albà Soler

1
Contents
1. Introduction
• What will we learn
2. Use Cases in UML
• Use Case Diagram
• Actors
• Extensions
3. Activity Diagrams
4. Sequence Diagrams
1. Introduction
What will we learn?
• Dynamic or Behavioral things are the dynamic parts of UML models. These are the verbs
of a model, representing behavior over time and space.
• The dynamic model describes these aspects of the system that can change over time. Both
Intra-object: change of state of an object that receives a given event, and Inter-object:
show how objects interact with each other.
• What are we going to see in this section? Modelling Elements! Such as:
ü Textual description of use cases (seen in Module 3) and Use Cases Diagrams.
ü Activity diagram.
ü System Sequence diagram.
• OOA/D uses the Analysis done in UML use cases and diagrams to help developers
understand the requirements and to design software. OOAD uses UML diagrams to
represent the different components and interactions of a software system.
1. Introduction
What will we learn?
1. Introduction
What will we learn?
OOA/D

Activity Dynamic
Diagrams Model

OOA/D

Sequence UML Use Case


Diagrams Diagrams

Behavior
Diagrams
1. Introduction
• Book References

ü Object-Oriented Analysis and Design with Applications 3rd ed. G Booch et


al. Ed Addison-Wesley Object Technology Series
ü Applying UML and Patterns 3rd ed. C. Larman. Ed Prentice Hall
ü UML in Practice. P Roques. Ed Wiley
ü UML 2.0. R Miles. Ed O’Reilly
ü UML Unified Modeling Language. Tutorials point SimplyEasyLearning
ü Writting Effective Use Cases. Alistair Cockburn. Ed Addison-Wesley
1. Introduction

UML topic Video tutorial


UML Modeling https://youtu.be/qoxoX3ZiazI?si=hjMVkshhZ--z-h-s

Sequence Diagram https://youtu.be/H_GnFIhMXDg?si=kLnQ-1qkLcQJtRHc


https://youtu.be/nOtF-IY9uWA?si=9gBiChjBnIaOa14t
State Diagrams https://youtu.be/Rk3cPADj__M?si=2nAFvudPVhlhj4NY
https://youtu.be/j77wzk4hbMg?si=NqCxJk3ayrPA-5y-
Activity Diagrams https://youtu.be/GoYdpOVhDRc?si=w9j6NfkXaL3DZZ6J
https://youtu.be/y1pItD9z5Rs?si=JADEVl1yqqQkVaZa
Contents
1. Introduction
• What will we learn
2. Use Cases in UML
• Use Case Diagram
• Actors
• Extensions
3. Activity Diagrams
4. Sequence Diagrams
2. Use Cases in UML
UML Use Case Diagram

• UML use cases diagram capture high-level functionality of a system.

• UML provides notations for actors, use cases and relationships between them.

• Contain a summary of all identified use cases and textually documented.

• Use case diagrams has four key elements: Actors, Use Cases, System and
Associations Use Case Diagram.
2. Use Cases in UML
UML Use Case Diagram

• Actors are represented as a


stickman.
• Use cases draw as a bubble with the
title inside.
• Box represents the boundaries of
the system.
• Associations are lines from actors to
use cases Use Case Diagram.
2. Use Cases in UML
UML Use Case Diagram

• Primary actors: whose goal is fulfilled


by the use case.
• Secondary actors: involved in the use
case. Placed on the right of the
conversation.
• Non-human actors can be represented
with a box.
• Use <<>> is often used to denote a
special type not covered by UML
actors.
2. Use Cases in UML
UML Use Case Diagram

• Use cases diagram can be extended by


adding relationships between actors.

• Specialisation / generalisation: child


actor inherits roles and
communications in use cases from the
parent actor.
2. Use Cases in UML
UML Use Case Diagram
2. Use Cases in UML
• Case extensions: Add <<include>> relationships between cases.
• We can use it when the same sequence is used by more than
one use case.
• Common steps are added to an independent use case, and all
use cases that may need this sequence include this use case
(we reduce redundancy).
• Included use cases are activated by the use case including
them, not by the actor.
• This is the most common and important relationship. It is
common to have some partial behavior that is common across
several use cases. For example, the description of paying occurs
in several use cases. Rather than duplicate this case, it is
desirable to separate it into its own subfunction use case, and
indicate.
2. Use Cases in UML

• Add <<extend>> relationships between cases.


• Extend a use case with additional behaviour to a base case.
• Extend use cases can be activated by an individual actor.
• Suppose a use case should not be modified (at least not
significantly) for some reason. Perhaps continually
modifying the use case with new extensions and
conditional steps is a maintenance headache, or the use
case has been baselined as a stable artifact, and can’t be
touched. The idea is to create an extending or addition use
case, and within it, describe where and under what
condition it extends the behavior of some base use case.
2. Use Cases in UML
UML Use Case Diagram: Extensions
Contents
1. Introduction
• What will we learn
2. Use Cases in UML
• Use Case Diagram
• Actors
• Extensions
3. Activity Diagrams
4. Sequence Diagrams
3. Activity Diagrams
• UML use cases show what the system should do. Activity diagrams allow you to
specify how your system will accomplish these goals.
• Activity diagrams show high-level actions chained together to represent a process
occurring in the system.
• Activity diagrams are particularly good at modeling business processes. A business
process is a set of coordinated tasks that achieve a business goal (such as shipping
customers’ orders). Some business process management (BPM) tools allow you to
define business processes using activity diagrams, or a similar graphical notation.

• Activity diagrams are the only UML diagram in the process view of your system’s
Model (as described in Module 3, section 3).
3. Activity Diagrams
• Activity diagrams are flowcharts that show the flow of activities performed by the
system. Can be helpful to capture and discuss complex use cases scenarios.
• Example: activity diagram for an order management system:
3. Activity Diagrams
• Eight key elements:

ü Start,
ü Activity
ü Flow
ü Fork
ü Join
ü Decision
ü Merge
ü and End

• Fork split the incoming flow in two or more concurrent flows. Join bar allows two or
more parallel flows to be joined into a single outgoing flow and synchronise all
incoming flows.
3. Activity Diagrams
• Example: user login
system for an App.
3. Activity Diagrams
• Steps to draw an activity diagram:

Stage 1 Stage 4
Stage 2 Stage 3
Identify the Apply
Identify the Identify
initial stage appropiate
intermediate conditions or
and the final notations and
activities constraints
stage symbols
3. Activity Diagrams
• Swim-lanes (also called
partitions) in activity diagrams
split the diagram horizontally or
vertically.
• Each row/column is assigned to
an actor.
• All actions in a row/column are
performed by the corresponding
actor.
3. Activity Diagrams
• Example: modeling the Process
Sale use case with an activity
diagram.
3. Activity Diagrams
• Example: a data flow view for a
Process Sale scenario using an
activity diagram with several
actors.
• In data flow views, we use UML
datastore nodes.
3. Activity Diagrams
• Example: an activity diagram with UML software design https://sparxsystems.com/

https://youtu.be/KzB66CNnpzg?si=FEpt894EkzzfaCQL
Contents
1. Introduction
• What will we learn
2. Use Cases in UML
• Use Case Diagram
• Actors
• Extensions
3. Activity Diagrams
4. Sequence Diagrams
4. Sequence Diagrams
• Sequence diagrams are one of the most widely use UML diagrams.
• They allow a temporal (dynamic, evolution over time) representation of
interactions between two or more entities within a scenario.
• Captures the exchanges messages between classes and actors and the timeline of
events. These diagrams focus on showing detailed interactions, such as which
objects are involved in an interaction, which methods are invoked, and the
sequence of events.
• Sequence, and also communication diagrams are UML diagrams that can also
model the dynamic behavior. Sequence diagrams are an important member of the
UML group known as interaction diagrams that model important runtime
interactions between the parts of the system. They work alongside communication
diagrams and timing diagrams.
4. Sequence Diagrams
• Use cases allow the model to describe what the system must do; clases (in the
next Module 5) allow your model to describe the different types of parts that
make up your system’s structure. There’s one piece that’s missing: with use cases
and classes alone, you can’t yet model how the system is actually going to do its
job. This is where interaction diagrams (and sequence diagrams) come into play.
• Sequence diagrams are all about capturing the order of interactions between
parts of your system. Using a sequence diagram, you can describe which
interactions will be triggered when a particular use case is executed and in what
order those interactions will occur. Sequence diagrams show plenty of other
information about an interaction, but their forté is the simple and effective way in
which they communicate the order of events within an interaction.
• Sequence diagrams are the only UML diagram in the logical view of the Model
(as described in Module 3, section 3).
4. Sequence Diagrams
• Two read directions
ü Horizontally : Arrows indicate
direction of the message.
ü Vertically : Chronological order of
the messages.
• Elements of a sequence diagram:
ü Participants
ü Lifeline
ü Interaction messages
ü Activation or execution
specification
4. Sequence Diagrams

• Participants: live objects, we use the


notation “ObjectName : Class”
• Lifeline: from top to bottom showing
the object is alive.
• Interaction messages: arrow that
indicates an operation call. The dotter
arrow is the response to the operation
call.
• Activation bar: object is alive, waiting
for the execution to be completed.
4. Sequence Diagrams

• Sequence diagrams help to


identify class methods.
• Messages to an object can
be translated by methods
inside the object.
• Message response can be
translated as a return value
of the method.
4. Sequence Diagrams

• Opt: option. It’s like an if


without an else.

• Alt: alternative. One or more


alternate conditions. If the
first condition is not true, act
as an if-else condition.

• Loop: block of messages that


continue to get passed as the
condition is true.
4. Sequence Diagrams
• Example: system sequence diagram of a basic sales scenario
4. Sequence Diagrams
• Example: system sequence diagram of the credit card payment scenario
4. Sequence Diagrams
Symbol Name Description
• Example: system sequence
Rectangle diagram of the credit
Object Symbol carda payment
Represents scenario
class or object

Vertical rectangle Activation box Represents the time taken by object to


complete a task
Sticky Symbol Actor symbol Show entity with the system

Small vertical rectangle Lifeline symbol Represents the passage of time


with dashed line
beneath the rectangle

Frame Used for loop and Used to model loop construct or


alternative condition conditional statement

Arrow Synchronous message Used to show a message send from a


symbol sender

Arrow with dashed line Return message symbol Shows the reply messages
4. Sequence Diagrams
• You can find a good step-by-step guide of sequence diagrams, with many practical
examples:

https://creately.com/guides/sequence-diagram-tutorial/
2. Use Cases in UML

https://youtu.be/pCK6prSq8aw

You might also like