0% found this document useful (0 votes)
14 views26 pages

Lab 1b. Draw UML Diagram

The document discusses requirement analysis for software development using UML diagrams. It explains how to create use case and sequence diagrams to represent the functions and interactions of a system based on requirements. Sample diagrams are provided for a jewelry store management system and steps are outlined to develop the diagrams.

Uploaded by

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

Lab 1b. Draw UML Diagram

The document discusses requirement analysis for software development using UML diagrams. It explains how to create use case and sequence diagrams to represent the functions and interactions of a system based on requirements. Sample diagrams are provided for a jewelry store management system and steps are outlined to develop the diagrams.

Uploaded by

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

Analysis

Requirement analysis is an action that turns human language into SE


language.

Usecase Class
diagram diagram
Analysis
I would a software
that can ABC, XYZ
Sequence

diagram

Note that we only deal with simple requirements.


In this week, we learn how to create usecase & sequence diagram
1
UML Diagram
Almost all diagrams are visualized by UML (Unified Modeling
Language)
UML is a language for the specification, visualization, construction, and
documentation of software systems. It includes rules, shapes, symbols,

Usecase diagram describes what function the software must have.


Sequence diagram describes how software functionality works based
on the interactions between components in the system.
Class diagram describes what class the software must have.
2
Sample project - Jewelry store management
Requirements:
- The website allows normal users to view items online, employees can
input bills while buying offline and manage import/export items. The
manager can manage employees and know store revenue.
- I would show items on the homepage. The best selling items will on
the top, the other items are cluster by category.

3
Usecase diagram
First step: define actor - who can use software
What type of actors are needed in requirement?

4
Usecase diagram
User
Use UML User
Employee
Manager

Employee

Manager
5
Usecase diagram
Second step: define usecase - the function that the actors will use
What functions are needed in requirement?

6
Association Usecase

Usecase diagram
Register
User
User:
Sign in, Sign out Sign in

Register, Read items


Employee: Sign out
Use UML Employee
Sign in, Sign out
Create bill CRUD
item
CRUD item and its quantity
CRUD user CRUD
Manager
employee
Manager:
Sign in, Sign out, Register
CRUD employee These are needed separate
7
Usecase diagram
Third step: define relationships between actor and actor, usecase and
usecase, actor and usecase.

8
Generalization
Register

Register
Sign in
User User

Sign in
Sign out

Sign out Read


Employee item
Manage
CRUD <<extend>>
item
Update
item
CRUD <<include>>
Manager
employee <<include>>
Employee
CRUD
These are needed separate item 9
Register

Signin

User

Signout

Create bill

Employee Read items

<<include>> Create
<<include>> items
CRUD Update
<<include>>
items items
Manager
<<include>>
Delete
items 10
Usecase diagram
Fourth step: draw by PowerPoint, Visio or draw.io

11
Exercise
A company specializing in the business of electronic devices wants to
build an e-commerce system.
The new system must ensure that customers visiting the website can
easily select products, view promotions and make purchases. Payment
can be made online or in-store. Customers can receive goods at the
store or use delivery service.
In addition, the system also needs a module to ensure the company
manages business activities such as the quantity of goods in stock,
order management, delivery status, payment, etc.

12
Cart / Search
Purchase

View <<include>> View


detail
product

Buy
View
promotion
User Login /
Logout
Account <<include>>

Register

Item
management
Order
status
Seller
<<include>>
Order
Support
management
customer
13
Object
:User :LoginTab :Backend
Sequence diagram
1. Enter
username /
pass
Object 2.
Login()
3. Validate()
Stimulus (message) 4. Message()

alternatives alt 5.1.


Message()
[If Message()
is Success] 6.1. GoTo
Home()

[else] 5.2.
Message() 6.2. Do
Nothing()

Time 14
Sequence diagram
First step: define the function by getting information from Usecase
diagram

15
Sequence diagram

Register

Sign in Sequence diagram of Register

User Sign out

Sequence diagram of Sign in / Sign out


16
Sequence diagram
Second step: base on Activity diagram (Algorithm) and business,
defining procedures of the diagram.

:username
:password

Input Validate Message

success Go to
fail homepage

17
Sequence diagram
Third step: determine the class in the system that participates in the
business.
User
:username Backend
Frontend
:password

Input Validate Message

success Go to
fail homepage

18
Sequence diagram
Fourth step: draw!

19
Exercise
A library is doing the digitization of book management.

Readers can view book information online based on book title.

20
:User :ViewTab :ReadBook :dbBook

1. Enter book
title

2. Request()
3. Request()

4. result
5. result

alt 5.1. Return


result()
[If len(result)
> 0]
6.1. DisplayBook()

[else] 5.2. Return


result() 6.2. MessageNotFound()

21
Class diagram Class name

ACCOUNT DETAIL_BILL
Composition Attribute
CUSTOMER Username
Hash …
Name Type Method

Update()
Association
EMPLOYEE ITEM
Name: String BILL Name
Manager: Employee Price
Date
UpdateName(String newname): Generalization Type Type
Boolean

IMPORT_BILL …

Detailed class

22
Class diagram
The class diagram is the hardest diagram. Defining classes base on:
- Requirement
- Usecase diagram

Entity => Attribute => Method => Relationship

23
Database diagram Table

ACCOUNT Key DETAIL_BILL


ID (PK) ID_Bill (FK)
CUSTOMER Field ID_Item (FK)
Username
ID (PK) Hash
ID_Account (FK) Type
Name

Relatiopship
ITEM
EMPLOYEE BILL ID (PK)
ID (PK) ID (PK) Name
ID_Account (FK) ID_Customer (FK) Price
Name ID_Employee (FK) Type
ID_Manager Date
Type
IMPORT_BILL

24
Database diagram
Map classes to tables:
- Add key
- Attribute => Field
- Relationship => Foreign Key

25
Exercise
Library management database

- Book
- Reader
-…

26

You might also like