Post Office

OBJECT MODELING
ANSWERS
Post Office
Situation: Consider a typical post office and the processes involved in selling stamps, renting
post office boxes, and delivering mail to postal customers.
1. Identify possible actors and use cases involved in post office functions.
Actors might include Customer, Postal Worker, and Route Carrier. Use cases might include Buy
Stamps, Manage Stamp Inventory, Rent P.O. Box, Certify Mail, Deliver Mail, Sort Incoming
Mail.
Sample documentation for the Buy Stamps use case is shown in the following table.
Name:
Actor:
Description:
Successful
Completion:
Alternative:
Pre-condition:
Post-Condition:
Assumptions:
Buy Stamps
Customer/Postal Worker
This use case describes the process used to buy stamps at the post office
1. Customer requests stamps
2. Postal Worker checks on availability of stamps
3. Stamps are available and customer pays fee
4. Customer receives stamps and stock is adjusted
1. Customer requests stamps
2. Postal Worker checks on availability of stamps
3. Stamps are not available and customer selects alternate stamps or no
stamps
4. Customer receives stamps and stock is adjusted (if alternate stamps
selected) or customer leaves with no stamps
Customer wants to purchase stamps
None
None
2. Create a use case diagram for the post office system.
A sample use case diagram for the Buy Stamps and Manage Stamp Inventory use cases follows:
Requests
Stamps
Sells
Stamps
Buy Stamps
Customer
Postal
Worker
Adjusts
Inventory
Changes
Min/Max
Levels
Manage Stamp
Inventory
2
3. Select one of the use cases and create a class diagram.
A sample class diagram for the Buy Stamps use case follows:
Requests
stamps
Postal Worker
Employee number
SSN
Name
Hire date
Date of birth
0..*
Customer
Customer type
Payment method
0..*
Request stamps
Purchase stamps
Make payment
Send mail
Receive mail
Request other services
Sell stamps
Certify mail
Sort mail
Deliver mail
0..*
0..*
Sells
stamps
1..*
1
Adjusts
Changes
min/max
levels
1..*
Transaction Record
Stamp Inventory
Stamp ID
Date
Number purchased
Amount due
Payment method
Stamp ID
Stamp denomination
Quantity in stock
Minimum level
Maximum level
Adjust minimum
Adjust maximum
Report stock value
Apply adjustment
Adjust stamp inventory
3
4. Create a sequence diagram for the use case you selected.
A sample sequence diagram for the Buy Stamps use case follows:
Postal
Employee
Customer
Stamp
Inventory
Transaction
Record
Request
Stamps
Check Availability
Notify
STUDEN
T
Pay
Handle
Transaction
Decrease
Inventory
X
4