0% found this document useful (0 votes)
27 views26 pages

Lecture 6

The document discusses UML behavior modeling diagrams including state machines, activity diagrams, and interaction diagrams. It describes sequence diagrams in detail, covering their components like objects, lifelines, messages, and synchronous vs asynchronous messages. It also discusses sequence diagram fragments, loops, recursion, and provides an example of withdrawing money from an ATM.

Uploaded by

Daud Luhela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views26 pages

Lecture 6

The document discusses UML behavior modeling diagrams including state machines, activity diagrams, and interaction diagrams. It describes sequence diagrams in detail, covering their components like objects, lifelines, messages, and synchronous vs asynchronous messages. It also discusses sequence diagram fragments, loops, recursion, and provides an example of withdrawing money from an ATM.

Uploaded by

Daud Luhela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 26

IS 274: SYSTEM

BEHAVIOR
Dr. Salome Maro
23rd May 2022
UML AND BEHAVIOUR
MODELLING
 UML gives 3 diagrams to model system behaviour:
 State machines
 Activity diagrams
 Interaction diagrams
UML AND BEHAVIOUR
MODELLING
 UML gives 3 diagrams to model system behaviour:
 State machines
 Activity diagrams
 Interaction diagrams
SYSTEM BEHAVIOR
 State Machines: These describe which states an object can have during its life
cycle, and the behaviour in those states along with what events cause the state
to change;
 for example, an invoice can be paid (state paid) or unpaid (state unpaid).
 Activity diagrams: show communication in a system, but they focus on
workflow.
 Interactions diagrams: describe how objects communicate with each other.
How and which messages and sent and received.
INTERACTION DIAGRAMS
 UML provides four types of interaction diagrams:
 The sequence diagram, which shows objects interacting along lifelines that
represent general order.
 The communication diagram shows the messages passed between objects,
focusing on the internal structure of the objects.
 The interaction overview diagram treats a sequence diagrams as the unit
for a modified activity diagram that does not show any of the interaction
details.
 The timing diagram shows interactions with a precise time axis.
SEQUENCE DIAGRAMS
 Sequence diagrams illustrate how objects interact with each other.

 They focus on message sequences, that is, how messages are sent and received
between a number of objects.
SEQUENCE DIAGRAMS
 Show concurrent processes and activations

• Show time sequences that are not easily depicted in other diagrams

• Typically used during analysis and design to document and understand the
logical flow of your system

Emphasis on time ordering!


SEQUENCE DIAGRAMS
 Sequence diagrams have two axes:
 the vertical axis shows time and
 the horizontal axis shows a set of objects.

 A sequence diagram is enclosed by a rectangular frame with the


name of the diagram shown in a pentagram in the upper-left corner
prefixed by sd.
 To read the sequence diagram, start at the top of the diagram and
read down to view the exchange of messages taking place as time
passes.
SEQUENCE
DIAGRAM --
EXAMPLES
Name of the Objects
sequence
diagram

Method call

Execution

Lifeline
Return value
SEQUENCE DIAGRAM
Time Increasing -->

All lines should be horizontal to indicate


instantaneous actions. Additionally, if ActivityA
happens before ActivityB, ActivityA must be above
activity A
Lower = Later!
SEQUENCE DIAGRAM
Objects: aStudent is a specific
instance of the Student class

Generic (unnamed)
Specific Generic
objects(unnamed)
Instance of an objects of class type Seminar
Object and Course
COMPONENTS

execution
lifeline
COMPONENTS

Method call

Return value
SYNCHRONOUS VS
ASYNCHRONOUS MESSAGES
 Synchronous message call : A message is sent from the source lifeline to the
target lifeline. The source lifeline is blocked from other operations until it
receives a response from the target lifeline.

 Example: A bank teller might send a credit request to the bank manager for
approval and must wait for a response before further serving the customer.
SYNCHRONOUS VS
ASYNCHRONOUS MESSAGES
Asynchronous message call : The source lifeline is not blocked from receiving
or sending other messages. You can also move the send and receive points
individually to delay the time between the send and receive events. You might
choose to do this if a response is not time-sensitive or order- sensitive.

Example: A bank customer could apply for credit but can receive banking
information over the phone or request money from an ATM, while waiting to
hear about the credit application.
SEQUENCE FRAGMENTS
 Sequence diagrams can be broken up into chunks called fragments.
 These fragments are surrounded by a frame like the one around the whole
diagram.
 the specifier in the upper-left corner represents an operator that prescribes how
the fragment is handled.
 Fragments can have:
 Alternatives
 Loops
ALTERNATIVES
LOOPS
RECURSION
 Objects can invoke its own operations
 There must be a condition in the operation that stops the
recursion.
CLASS ACTIVITY
 Draw a sequence diagram of withdrawing money from an ATM machine.
REFERENCES
 Some slides borrowed from Dan Fleck
 UML 2 Book
TEST 2
 Thursday 26th May
 Completely online
 Time : 12:15 – 13:00 (Strict)
 Any signs of copying will be penalized.

 Attempt the pre-test on LMS to see if the test works well in your PC with the current security
features.

You might also like