Академический Документы
Профессиональный Документы
Культура Документы
Introduction
• A Sequence diagram depicts the sequence of
actions that occur in a system.
• The invocation of methods in each object, and the
order in which the invocation occurs is captured in
a Sequence diagram.
• This makes the Sequence diagram a very useful
tool to easily represent the dynamic behavior of a
system.
• A Sequence diagram is two-dimensional in nature.
On the horizontal axis, it shows the life of the
object that it represents, while on the vertical axis,
it shows the sequence of the creation or
invocation of these objects.
Message Arrows for Communications
OOAD 11
Withdraw saving
Use Case: Withdraw Saving
Actors: Bank, Client
Flow of Events:
1. Bank client insert ATM card into ATM machine
2. ATM machine request PIN code
3. Bank client enter PIN code
4. Verify PIN code entered with saving account
5. ATM machine request amount if the PIN is valid
6. Bank client enter the required amount
7. Process the transaction in the client account
8. ATM machine dispense cash
9. ATM machine print receipt when the transaction completed
12
Identifying Classes
– Bank Client
– ATM Card
– ATM Machine
– Savings Account
– Cash
– Message
OOAD 13
Client ATM-Machine SavingAccount
Request PIN
PIN valid
Request amount
Enter amount
Process transaction
Transaction successful
Dispense cash
Print receipt
Example 2: Buying Tickets
An interaction between a customer, ticket seller, database and printer.
Example 3: Logging in
Let's start with the simple example above: a user logging onto the
system. The Logon use case can be specified by the following step:
1. Logon dialog is shown
2. User enters user name and password
3. User clicks on OK or presses the enter key
4. The user name and password are checked and approved
5. The user is allowed into the system
Alternative: Logon Failed - if at step 4 the user name and password are not
approved, allow the user to try again
Example 4: Course Enrolment System
Example 5: Product Order
Example 6: Search Engine
QUESTIONS