0% found this document useful (0 votes)
52 views

Swe1 Uml Examples Sol

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Swe1 Uml Examples Sol

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Example 1

• Grocery Store System


• You are building a store management system.
Customers enter the store and select vegetables.
When they are finished, the bring their items to a
cashier in order to purchase them.
• Cashiers, while logged in to their terminal, can also
refund purchases and update the store inventory.
• A manager monitors the inventory and orders
additional stock if needed.
• What are the actors and use cases of this system?
voting machine
• Draw a Use Case Diagram for a voting machine, on
which voters can see a list of candidates and select
one to vote for. The machine should check that each
voter is eligible to vote. The electoral registrar will
also want to print a summary of the total votes for
each candidate, and (separately) a list of the voters
who have voted, and a list of those who haven’t. In
case of a dispute, the machine should also list a
complete record of who voted for whom, but only a
judge can use this function.
Use Case
• Draw a use case diagram to represent the
following system.
• Over the summer holiday, university students can
book college hall accommodation online. They
must specify their name, student number, course,
year, and identify three college residences as
their preferences.
• The system makes an allocation of students to
rooms before the start of the term, trying, where
possible, to allocate students to a room in one of
their preferred halls.
• A final exam for a given course is prepared by the instructor
of the course and submitted to the DCS undergraduate
office.
• The undergraduate office sends all exams to the Faculty of
Arts & Science office where copies are made.
• On the day of the exam, copies are given to the presiding
officer who takes them to the room where the exam is
given.
• The students write the exam on an exam copy, and return
to the presiding officer at the end of the exam. The written
exam copies are given to the instructor for marking.
• Draw a sequence diagram that captures this description
Class example
A company consists of departments. Departments are located in one or
more offices. One office acts as a headquarter. Each department has a
manager who is recruited from the set of employees. Your task is to
model the system for the company.
Draw a class diagram (with attributes, where appropriate) that describes
entities and relationship. In particular, students are members of teams.
Each team has 2 or 3 members. Each team completes 0 to 3 assignments.
Each student takes exactly one midterm test. Computer Science students
have a single account on the CDF facility, while each engineering student
has an account on the Engineering facility. Each assignment and midterm is
assigned a mark.
Example Sequence
• To buy a book electronically from chapters.com, a customer
needs to select the book from a list provided by Chapters’
eCommerce system, provide credit card information to the
system, then the system gets authorization from the bank for
the payment, and -- if positive -- confirms the sale.
• The order is then sent to the orders department and when
the book becomes available, it is shipped to the customer.
Also, the order department charges the customer’s credit card
by informing the bank of the amount.
• Draw a sequence diagram that models this process.
Health portal
• The Piedmont region is the public health provider for citizens living in the region.
To improve the health services the region has developed a web portal, accessible via
PC and Smartphone, to deliver a number of services both to citizens, analysis labs,
general practitioners.
• A citizen, to access any medical service from the public system, must first select a
general practitioner. A general practitioner issues analysis requests, medicine
requests, and so on. A citizen selects an analysis lab to perform an analysis, as
requested by the general practitioner.
• To access any service an end user has to authenticate first. Authentication is
performed via SPID, the authentication service for Italy. In principle, every Italian
citizen should obtain a digital identity provided by SPID. This identity is used to
access any service offered by the public administration. The service and the SPID
interact to provide the authentication. A citizen accesses a service, the service
redirects to the SPID, the citizen sends to the SPID service its social security number
and password, receives an OTP (one time password) via SMS on her cellphone,
introduces the OTP. If all is correct the user is authenticated and sent back to the
service for a one session interaction. In this case the service is health portal for a
session.
Health portal
• The portal can be used by a citizen to
• Upload health documents. A health document in pdf format can be of several types
(ex lab analysis result, lab analysis request, medical report etc), has an issue date and
a doctor who signs it.
• Browse or search health documents
• Open, read, download a health document
• Browse through available general practitioners, select a general practitioner
• Browse through available lab analysis, send a lab analysis request to the selected lab
• In its turn a general practitioner can use the portal to
• Browse the list of citizens she takes care of
• Select a citizen
• Browse, select, read, download a health document belonging to the citizen
• Upload a lab analysis request for the citizen
• Finally, an analysis lab can use the portal to send the resulting lab analysis result to
the concerned citizen
• In the following you should analyze and model a client server application to
implement the web portal.
Health portal
• Define the interfaces (table below) and context
diagram

The SPID is external to the health portal, but it interacts with it to perform the
authentication, so it should be represented as an actor
Use case
• Draw a use case diagram to represent the following description of
the online grocery store, Groceries-R-us.
• Using the Online Order System, the Customer places their order. To
place an order, the Customer adds items to, and may remove items
from, the order. When they are finished, they submit the order and
the order placement is complete. The Order Clerk at Groceries-R-us
retrieves the order from the system and assigns it to a Delivery
Person.
• The Delivery Person delivers the order to the Customer. While
delivering groceries, the Delivery Person sometimes consults the
Groceries-R-us satellite (GPS) Directions System for driving
directions to the Customer’s home. After the groceries have been
delivered, the Customer signs the delivery slip for the Delivery
Person (to acknowledge receipt who returns it to the Order Clerk).
Upon receipt of the signed delivery slip, the Order Clerk issues an
invoice to the Customer
• Using the description from previous question,
prepare a sequence diagram that shows the
sequence of events involved in a successfully
delivered order (from the Customer submitting the
order to receiving the invoice). The diagram should
clearly show the interactions between the Customer,
the Online Order System, the Order Clerk, the
Delivery Person and the Direction System.

You might also like