软件体系结构

阅读: 评论:0

软件体系结构

软件体系结构

Three instances of software modeling and design

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.

Banking system (C/S software architecture case study)

problem description

所有名词都应该被记录并考虑。动词也是吧。
Therefore, here are the relevant key words:

  1. bank, several ATMs, a central server

  2. for each ATM, a card reader, card dispenser, a keyboard/display, a receipt printer.

  3. 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.

use case model for banking system context and entity classes

Now that we figure out the problem by analyzing the description, we now build the use case model.

  1. there are two actors: customer and ATM operator.
  2. for customer, there are three transactions: withdraw, query, transfer. for operator, two actions: start up, close down, replenish the dispenser.
  3. input devices: card reader and keyboard. output devices: printer, dispenser.
    therefore, 5 cases + Validate PIN use case are identified.

static modeling

problem domain, system context & entity classes

  1. problem domain: bank, ATM, two actors, ATM card reader, cash dispenser, keyboard, printer. && their relations.
  2. system context: the Banking system (what we have to design ourselves) are shown as one aggregate(聚合的) class.
    and show its interfaces to external classes.
    therefore, I/O devices are modeled as external classes.
    and plot two actors, 4 I/O devices, software system & their relations.
  3. entity classes: we have to identify that which classes are entity classes.
    In my view, these should be: Bank, ATM info, accounts, customer, operator??? transaction.
    plot the attributes of each entity class.

objects structuring

  1. C/S subsystem structuring: two subsytems (ATM client and banking service), external devices/users, and their relations.
  2. ATM client object and class structuring: boundary objects: banking system(an aggregate class) including boundary classes for each external devices/actors.
  3. ATM client object and class structuring: objects participating in use cases: all entities, interfaces inside the ATM client subsystem.
  4. Service subsytem object structuring: business logic objects.

dynamic modeling (interaction diagrams)

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

state chart for ATM control: validate pin use case.

design model

very complicated…

写作时间:2018-06-06

本文发布于:2024-01-29 06:08:16,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170647969913247.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:体系结构   软件
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23