8 Advanced Interaction Modeling: Here Are Answers For An Electronic Gasoline Pump. Figure A8.1 Shows A Use Case Diagram
8 Advanced Interaction Modeling: Here Are Answers For An Electronic Gasoline Pump. Figure A8.1 Shows A Use Case Diagram
74
Chapter 8 Answers to Exercises 75
8.2 Figure A8.2 shows a use case diagram for an online travel agent.
«include»
make purchase provide payment info
Customer
«include»
provide address
8.3 Figure A8.3 shows a use case diagram for the online frequent flyer program. Finding a
free flight is the same as finding a paid flight, except seats are limited for free flights
(hence the extend relationship). When submitting a claim for missing credits, a user must
first view their existing credits (hence the include relationship).
8.4 Figure A8.4 shows a use case diagram for the electronic music management software.
We chose to make the CD an actor, because it is an external entity apart from the elec-
tronic music software.
8.5 Figure A8.5 shows a use case diagram for a simple payroll system.
76 Chapter 8 / Advanced Interaction Modeling
book award
check free
flight avail.
book free book free book free
flight car rental hotel «extend»
check prices
and routes
update account
Customer Airline
submit
missing credit
«include»
view credits
request credit
card application
Figure A8.3 Use case diagram for an online frequent flyer program
Chapter 8 Answers to Exercises 77
view songs
start play
stop play
create library
add song
destroy song
«include»
destroy library «include»
«include»
delete library
User
delete song
randomize order
play song
rip CD
create CD
CD
Figure A8.4 Use case diagram for electronic music management software
78 Chapter 8 / Advanced Interaction Modeling
update records
compute deductions
«include» «include»
«include» «include»
sum deductions
Employee Employer
compute income
«include» «include»
«include»
sum income
«include» «include»
compute net
take home pay
computeContents (date)
getTransactions (endDate)
stockContents := transactionSet
initialComposition +
sum(transactionSet)
Figure A8.6 Sequence diagram for computing the contents of a portfolio of stocks
8.7 Figure A8.7 computes the value of a stock portfolio on a specified date.
computeContents (date)
stockContents
getStockValues (date)
stock_valuePairSet
value
Figure A8.7 Sequence diagram for computing the value of a portfolio of stocks
80 Chapter 8 / Advanced Interaction Modeling
8.8 Figure A8.8 compute the values of a recursive stock portfolio that is limited to three lev-
els deep.
computeContents (date)
portfolio1 := portfolioContents
portfolio2
getStockValues (date)
stock_valuePairSet
value
Figure A8.8 Sequence diagram for computing the value of a recursive portfolio
Chapter 8 Answers to Exercises 81
8.9 Figure A8.9 shows the various activities and interactions for a DVD purchase.
request help
refer to
support
request help
consult with
engineering
recommend
an option
discuss
options
choose DVD
ship DVD
receive DVD
install DVD
mail payment
handle
payment
8.10 Figure A8.10 shows an activity diagram for the creation of a product.
create idea
:Product
[raw idea] simulate product
:Product check
[proposal] manufacturability
:Product
approve revisions [manufacturable]
Product
[manufacturable check
and correct serviceability
functionality]
:Product
approve revisions [serviceable]
:Product
[fully approved]