UML Sequence Diagram from itmbu sls broda.pptx

xiberi2562 5 views 29 slides Mar 01, 2025
Slide 1
Slide 1 of 29
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29

About This Presentation

Uml Sequence diagram important notes


Slide Content

UML Sequence diagram

Sequence diagrams are a type of UML diagram that show how objects in a system or classes within code interact with each other

Particularly these diagrams show interactions in the order. They take place in other words, they show the sequence of events

Let's diagram the interaction that happens at an ATM.

what are the parts involved in an ATM transaction? A person goes to an ATM to get money.

The ATM communicates with a bank server and that person's bank account is then accessed.

The ATM bank server and bank account are all a part of the ATM system. These three items are our objects. The person on the other hand is external to the system

Actors are represented by stick figures and objects are represented by rectangles

Actor represents the person trying to get money Then we'll add our objects alongside it We'll start by naming this object ATM because the person first interacts with the ATM then bank server and Finally bank account.  The objects to be placed in sequential order from left to right.

Lifelines are the vertical dashed lines that show the existence of an object or actor over time Moving down the Lifeline means that more time is passing. 

So we'll drag out a lifeline for the actor and for each of our objects

messages show the information being sent between objects

sequence diagrams show the order of interactions or Sequences and they do this by moving down the life line with each message

So we'll start with the first one at the top drag out a line that connects the actor life line to the ATM life line Now give it a label insert card. Next the ATM checks with the bank server to make sure it's a valid card. We'll drag out a line and place it between ATM and Bank server just below the previous message line. Well label this one verify card.

The server verifies the card and sends a message back to the ATM when an object sends a message back. This is called a return or reply message and they're always represented by a dashed line Return lines often move from right to left. The dashed line represents a return message or a message from the receiving object back to the requesting object. We'll label this message as card Okay,

A fter the card has been validated the ATM will ask for a pin. So we'll draw a line from the ATM to the actor and label it request pin Because this message isn't replying to an earlier message and is requesting information Rather than responding. This message is not a reply message and will be denoted by a solid line So what happens when the card is invalid like when an inserted card is expired?

This is when an alternative frame is used an alternative frame symbolizes a choice between two or more message sequences. These choices are usually mutually exclusive. So in this case the conditions are if the card is valid or if it's not . The upper portion of the box will be labeled if card is valid.

the lower portion will say else this says that if the card is valid tell the ATM and the ATM will request a pin if the card is not valid the server will tell the ATM and the ATM will eject the card

After the ATM has determined the card to be valid and requested a PIN the user will input their PIN Since the ATM requested the PIN and this is the user's response to that request. This message will be a return message So we'll make a dashed line from the actor to the ATM and label it PIN entered

The ATM will then ask the server if the pin is correct. We'll draw a line to represent that interaction and label it verify PIN Now we have the same situation as before where we'll need to use an alternative frame First we'll create what happens if the pin is valid the server will tell the ATM

The pin is valid and the ATM will ask the user how much cash they want to withdraw So we'll drag out our alternative frame and place it around the two new messages labeling the top portion if pin is valid. Next we'll add the alternative messages the server will tell the ATM. The pin is invalid and the ATM will eject the card .

The user will input an amount and the ATM will start a transaction with the server the server then asks the bank account if there are sufficient funds. if funds are sufficient the server will withdraw the amount until the ATM to dispense the cash If the funds are not sufficient won't want the transaction will be unsuccessful Finally the card will be ejected after the cash is dispensed or the transaction was cancelled With our interaction complete now we can add activation boxes.

Activation boxes show when and how long an object is performing a process This shows us at a glance when objects are active and when they are idle So we'll drag one out place it on the ATM lifeline and fit the box around the first and last message on the Lifeline We'll do the same for bank server and bank account Actors are external objects. They don't need an activation box
Tags