The instances are from the book “software modeling and design–UML, user cases, patterns and software architecture”. Now I analyze them and write them here.
所有名词都应该被记录并考虑。动词也是吧。
Therefore, here are the relevant key words:
bank, several ATMs, a central server
for each ATM, a card reader, card dispenser, a keyboard/display, a receipt printer.
behaviors:
a customer: withdraw money, query the balance of an account, transfer funds from one account to another.
a transaction is initiated when a customer inserts a card into the card reader (card number, start date, expiration date are encoded on the back)
card is recognized(info is read), system validates ATM card to judge that the expiration date is valid/PIN matches the PIN maintained/card is not lost
card is confiscated (没收) after three attempts to enter the correct PIN.
after the PIN is validated, customer can do three transactions: withdraw, query, transfer
withdraw: before it, system checks if the sufficient funds exist/check if there are sufficient funds at the local cash dispenser(分配器,自动取款机).
if true, the requested amount of cash is dispensed, and a receipt is printed, card is ejected.
transfer: system checks if the customer has at least two accounts, there are sufficient funds in the account to be debited.
for both query and transfer requests, a receipt is printed and the card ejected.
a customer may cancel a transaction at any time, transaction is terminated, card is ejected.
customer records, account records, and debit card records are all maintained at the server.
an ATM operator may start up and close down the ATM to replenish (补充) the ATM dispenser.
Now that we figure out the problem by analyzing the description, we now build the use case model.
problem domain, system context & entity classes
communication diagram & sequence diagram: ATM client validate pin use case
communication diagram & sequence diagram: Banking service validate pin use case.
& similarly for other 6 test cases.
state chart for ATM control: validate pin use case.
very complicated…
写作时间:2018-06-06
本文发布于:2024-01-29 06:08:16,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170647969913247.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |