Case Studies UML
Case Studies UML
Online Shopping
Web Customer actor uses some web site to make purchases online. Top level use
cases are View Items, Make Purchase and Client Register. View Items use case could be used
by customer as top level use case if customer only wants to find and see some products. This use
case could also be used as a part of Make Purchase use case. Client Register use case allows
customer to register on the web site, for example to get some coupons or be invited to private
sales. Note, that Checkout use case is included use case not available by itself - checkout is part
of making purchase.
Except for the Web Customer actor there are several other actors which will be described below
with detailed use cases.
Online Shopping - Credit Cards Processing
Primary actor for the system is a Merchant’s Credit Card Processing System. The merchant
submits some credit card transaction request to the credit card payment gateway on behalf of a
customer. Bank which issued customer's credit card is actor which could approve or reject the
transaction. If transaction is approved, funds will be transferred to merchant's bank account.
Authorize and Capture use case is the most common type of credit card transaction. The
requested amount of money should be first authorized by Customer's Credit Card Bank, and if
approved, is further submitted for settlement. During the settlement funds approved for the credit
card transaction are deposited into the Merchant's Bank account.
In some cases, only authorization is requested and the transaction will not be sent for
settlement. In this case, usually if no further action is taken within some number of days, the
authorization expires. Merchants can submit this request if they want to verify the availability of
funds on the customer’s credit card, if item is not currently in stock, or if merchant wants to
review orders before shipping.
Capture (request to capture funds that were previously authorized) use case describes several
scenarios when merchant needs to complete some previously authorized transaction - either
submitted through the payment gateway or requested without using the system, e.g. using voice
authorization
Credit use case describes situations when customer should receive a refund for a transaction that
was either successfully processed and settled through the system or for some transaction that was
not originally submitted through the payment gateway.
Void use case describes cases when it is needed to cancel one or several related transactions that
were not yet settled. If possible, the transactions will not be sent for settlement. If the Void
transaction fails, the original transaction is likely already settled.
Verify use case describes zero or small amount verification transactions which could also
include verification of some client's data such as address.
You can find excellent resources, documentation, white papers, guides, etc. related to the credit
card processing at Authorize.Net - Payment Gateway to Accept Online Payments.
Hospital Management
Hospital Management System is a large system including several subsystems or modules
providing variety of functions. UML use case diagram example below shows actor and use cases
for a hospital's reception.
Purpose: Describe major services (functionality) provided by a hospital's reception.
Hospital Reception subsystem or module supports some of the many job duties of hospital
receptionist. Receptionist schedules patient's appointments and admission to the hospital, collects
information from patient upon patient's arrival and/or by phone. For the patient that will stay in
the hospital ("inpatient") she or he should have a bed allotted in a ward. Receptionists might also
receive patient's payments, record them in a database and provide receipts, file insurance claims
and medical reports.
Bank ATM
ATM is initially turned off. After the power is turned on, ATM performs startup action and
enters Self Test state. If the test fails, ATM goes into Out of Service state, otherwise there
is triggerless transition to the Idle state. In this state ATM waits for customer interaction.
The ATM state changes from Idle to Serving Customer when the customer inserts banking or
credit card in the ATM's card reader. On entering the Serving Customer state, the entry
action readCard is performed. Note, that transition from Serving Customer state back to
the Idle state could be triggered by cancel event as the customer could cancel transaction at any
time. Serving Customer state is a composite state with sequential substates Customer
Authentication, Selecting Transaction and Transaction. Customer
Authentication and Transaction are composite states by themselves which is shown with
hidden decomposition indicator icon. Serving Customer state has triggerless transition back to
the Idle state after transaction is finished. The state also has exit action ejectCard which releases
customer's card on leaving the state, no matter what caused the transition out of the state.
Online Shopping - User Account
Every company having customers maintains customer accounts and supports a complete life
cycle of the account from its creation until it is closed. There are differences in what are the
stages (states) in the account's life cycle, and what are conditions or events causing account to
change its state.
Here we provide an example of user account life cycle in the context of online shopping, shown
as UML protocol state machine diagram.
For the user account to be created, it has to meet some initial requirements. For example, user id
(used as a login name) must be unique, at least for the existing accounts. After account was
created, it might need to be verified. Verification depends on the company and could include e-
mail, phone, and/or address verification. If account was not verified during some predefined
period of time, that account could be moved to the suspended accounts.
New, active, or suspended accounts could be cancelled at any time by client's request. Note, the
precondition for this usually includes payment of any outstanding balances, and might require
some separate account state or substate to handle this case.
User account might be suspended for security reasons, manually or automatically. For example,
website intrusion detection system locks user account for predefined period of time, if there were
several unsuccessful login attempts using incorrect account password. After account lock times
out, account is activated back automatically.
Some user accounts could be inactive for a long period of time. Company policy or business
rules could require moving such dormant for a year or two accounts to the suspended state.
Once we listed user account states and specified all possible transitions from one state to another,
we can review the diagram with other subject matter experts to see if anything is missing or
needs further clarifications.
Each class contains various attributes and methods(Functions) which call other class attributes to
share data.
1.Book Class contains attributes such as author,book name,price status,rack no,edition.
and functions such as display book details,update status.
2.librarian class contains attributes such as name,password and functions such as search
book,issue book,calculate fine,calculate bill.
3.transaction class contains attributes such as transaction id,member id bill id date of issue etc.
and functions such as create transaction delete transaction
4.Member record class contains attributes such as member id,type,date of issue,no of books,etc.
and functions such as increase book issue, decrease book issue,pay bill.
5.Bill class contains attributes such as bill no,date,member,amount and functions such as create
bill,update bill.
Online Shopping:
Each customer has unique id and is linked to exactly one account. Account owns shopping cart
and orders. Customer could register as a web user to be able to buy items online. Customer is not
required to be a web user because purchases could also be made by phone or by ordering from
catalogues. Web user has login name which also serves as unique id. Web user could be in
several states - new, active, temporary blocked, or banned, and be linked to a shopping cart.
Shopping cart belongs to account. Account owns customer orders. Customer may have no orders.
Customer orders are sorted and unique. Each order could refer to several payments, possibly
none. Every payment has unique id and is related to exactly one account.
Each order has current order status. Both order and shopping cart have line items linked to a
specific product. Each line item is related to exactly one product. A product could be associated
to many line items or no item at all.
ATM System: