You are on page 1of 6

Object Oriented Analysis & Design

Lab # 5

The objectives of lab 5 are to:


 Understand the System Sequence Diagram (SSD)
 Understand and implement UML notations for System Sequence Diagram

System Sequence Diagram (SSD):


• A System Sequence Diagram (SSD) is an artifact that illustrates input and output events related to the
system under discussion

• A system sequence diagram is used primarily to show the interactions between actor and system (as a
blackbox)

• For a particular scenario of use-case an SSD shows-

• The external actors that interact directly with the system.

• The System (as a black box)


• The system events that the actors generate.
Notations:

• Object: Objects are instances of classes.

• Object is represented as a rectangle which contains the name of the object underlined.

• Because the system is instantiated, it is shown as an object.


• Actor: An Actor is modeled using the ubiquitous symbol, the stick figure.

:Object1

: System

• Lifeline: The Lifeline identifies the existence of the object over time. The notation for a
Lifeline is a vertical dotted line extending from an object.

• Message: Messages, modeled as horizontal arrows between Activations, indicate the


communications between objects.

• Selection/Loop: Frame around part of diagram to indicate if or loop

• if -> (opt)[condition]

• if/else -> (alt) [condition], separated by horizontal dashed line


• loop -> (loop) [condition or items to loop over]

• Activation: thick box over object's life line; drawn when object's method is on the stack

messageName(argument)

Lifeline

Sample:

Process Sale Scenario


: Cashier :System

makeNewSale
Simple cash-only Process Sale scenario:
loop [ more items ]
1. Customer arrives at a POS checkout enterItem(itemID, quantity)
with goods and/or services to purchase.
2. Cashier starts a new sale.
3. Cashier enters item identifier. description, total
4. System records sale line item and
presents item description, price, and
running total.
Cashier repeats steps 3-4 until indicates
done. endSale
5. System presents total with taxes
calculated.
6. Cashier tells Customer the total, and total with taxes
asks for payment.
7. Customer pays and System handles
payment. makePayment(amount)
...

change due, receipt


Exercise
Task 1: Create a system sequence diagram for the following scenario of an elevator
1. The passenger pushes the destination floor button (internal button);
2. The system switches the floor button (internal button) light on;
3. The system closes the elevator door;
4. The system moves the elevator according to the destination floor direction (up/down);
5. The system stops the elevator at the destination floor;
6. The system opens the door at the destination floor;
7. The passenger moves outside the elevator;
8. The system switches the floor internal button off
Task 2: Create a system sequence diagram for the following flow of withdraw money from a local
bank ATM.
1. Customer arrives at the ATM machine and inserts a bank card.
2. The system requests for user authentication (request PIN number).
3. Customer inserts PIN number. System prompts user to select services.
4. Customer request withdrawal of money.
5. System prompts the amount of withdrawal.
6. Customer enters withdrawal amount.
7. System displays success of request message, ejects card and dispense money.
8. User collects card and money
Task 3: Create a system sequence diagram for the following main success scenario of a “book
check out” use case of a library.
1. The Worker tells the System the identity of a patron who wishes to check out books.
2. The System confirms that the patron is allowed to check out books, and remembers the
patron's identity.
3. The Worker tells the system the identity of a book this patron is checking out.
4. The System confirms that the book can circulate, calculates the due date based on whether the
patron is a faculty member or a student, and records that the patron has checked out this book,
which is due on the calculated due date, and makes that information available from the library
catalog.
5. The System tells the Worker the due date (which also confirms that the book has been checked
out).
6. The Worker repeats steps 3-5 until indicates done
Task 4: Create a system sequence diagram for the following scenario of a “add to cart” use case of
an online shopping system.
1. The user opens the website and selects the item category (e.g. dresses, accessories)
2. The user choose the item to purchase
3. The system check the availability of item; if item is available the system ask the quantity
4. The user enter the quantity and the click add to cart button
5. The system ask if user want to continue shopping
6. If user wants to do more shopping the system opens the item page

You might also like