Académique Documents
Professionnel Documents
Culture Documents
Bill Keller
Spring 2004
Lecture 1: Introduction
Introduction
– What the course is about
– What the course is not about
Aims and Outcomes
Teaching and Assessment
– Design Case Study
– Design Task
Recommended Reading
Deployment
Maintenance
Construction
Testing
Deployment
Revision can be costly
and difficult to manage Maintenance
Design, Evaluate
deploy, test
Classes organized
Employee
hierarchically
Manager Technician
Check
CardHolder
Balance
CardHolder
Check
Balance
Generalizes
Order
Relation
Statement
BankMember
BankMember
Order «include»
Note: include was Statemen
formerly called uses t
Check
Balance
Extend
CardHolder relationship
Check «extend»
Balance Print
Balance
CardHolder «include»
Withdraw
Cash Select
«include»
Account
Order
Statemen «include»
BankMember t
[Insufficient funds]
Select amount
[Sufficient funds]
User takes
Return card Notify user
card
Dispense cash
:ATMUI :CardHolder
select withdrawal
menu
select amount
withdraw
withdraw :Debit
sum debit add
sum account debit
dispense sum
return
card
withdraw(sum) withdraw(sum)
withdraw(sum)
/balance -=sum /balance -=sum
[sum >balance]
/balance -=sum
inCredit inDebit
entry/balance -= pen
deposit(sum)
[sum >= balance]
deposit(sum) deposit(sum)
/balance+=sum /balance += sum /balance+=sum
close close
CardHolder CardHolder
authorize()
Both attributes
Attributes shown and operations
CardHolder CardHolder shown, with type
lastName lastName:String information
firstName firstName:String
authorize()
CardHolder Account
holds
CardHolder Account
Named
association
CashDispenser ATMUI
1 1..*
CardHolder Account
holds
1 1 1
Screen CardReader KeyPad
0..* 0..*
Debit Credit
BankMember getDate() getDate()
getValue() getValue()
In object-oriented systems:
– individual objects are responsible for only a bit of
overall functionality
– useful high-level behaviour (use cases) realized by
objects working together
– objects interact by sending messages to each other
Collaboration is: “working together for the
purpose of providing some useful behaviour”
– documented by collaboration diagrams
ATMCustomer
Withdraw Cash:
The ATM customer selects the withdrawal menu, which is
displayed by the system. The card holder selects an
amount of cash. The system debits the user’s account,
returns the user’s card and issues the requested money.
Withdraw
cash
ATMUI Debit
user391 :CardHolder
:Account user391
Links may have
1
multiplicities
0..* Links are instances of
:Debit associations in the class
model
Links represent message
passing between
collaborating objects
Debit
:ATMCustomer
7: get balance()
:CardHolder :Account
:ATMUI :CardHolder
:ATMUI
Boundary object
8:return
:ATMUI card :ATMControl :CashDispenser
:ATMCustomer
4:withdraw
New ATMControl sum 5:debit
account 6:add debit
object mediates
between boundary
and entity objects
:CardHolder :Account :Debit
time
Object life-lines are
shown as dashed
lines running from
top to bottom of
diagram
:ATMUI :CardHolder
debit account Focus of control
Message shown shown as narrow
using an arrow rectangle
from sender to
receiver
Focus of control passes
from one object to
another as messages
flow between them
:ATMControl :Account
select withdrawal
menu
select amount
withdraw
withdraw :Debit
sum debit add
sum account debit
dispense sum
return
card
select withdrawal
menu
select amount
withdraw
withdraw :Debit
sum debit add
sum account debit
dispense sum
return
card
Simple states
Start state
inCredit inDebit
Transitions
Basic statechart
diagram for the
End state Account class
inCredit inDebit
deposit(sum) [sum > -balance]
inCredit inDebit
deposit(sum)/balance = balance + sum
withdraw(sum) withdraw(sum)
withdraw(sum)
/balance -=sum /balance -=sum
[sum >balance]
/balance -=sum
inCredit inDebit
entry/balance -= pen
deposit(sum)
[sum >= balance]
deposit(sum) deposit(sum)
/balance += sum
/balance+=sum /balance+=sum
close close
Start state
Insert card
Activities
Transitions
Enter PIN
Simple Activity
Diagram with start
and stop states Final state
Display Menu
ATMCustomer
Withdraw Cash:
The card holder selects the cash menu which is
displayed by the system. The card holder selects an
amount of cash. The system returns the user’s card
and issues the requested money.
[Insufficient funds]
Select amount
[Sufficient funds]
User takes
Return card Notify user
card
Dispense cash
ATM UI
Bank
Server
Account
Manager
Component diagrams
show how physical
units such as files,
Notation for
executables, etc. are
components
related
<<TCP/IP>>
:ATMClient :ATMServer
ATM.jar Bank.jar
Deployment diagrams
model configuration of
Nodes hardware elements
High
coupling Low
coupling
Sanity checks:
– Use CASE tools to ensure correctness/consistency
– Use compiler to ensure code is legal
Correspondence checks:
– Inspect product and specification for correspondence
– Make use of some kind of technical review
[Insufficient funds]
Select amount
[Sufficient funds]
User takes
Return card Notify user
card
Dispense cash
select withdrawal
menu
select amount
withdraw
withdraw :Debit
sum debit add
sum account debit
dispense sum
return
card
withdraw(sum) withdraw(sum)
withdraw(sum)
/balance -=sum /balance -=sum
[sum >balance]
/balance -=sum
inCredit inDebit
entry/balance -= pen
deposit(sum)
[sum >= balance]
deposit(sum) deposit(sum)
/balance += sum
/balance+=sum /balance+=sum
close close
View update
User interface split into
Controller View and Controller. View
renders objects/data in
notify Model. Controller accepts
modify user input events
Model
Administration
Servicing
Servicing