Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

CSC186 OBJECT ORIENTED PROGRAMMING

1
CSC186 OBJECT ORIENTED PROGRAMMING| edited from Zamlina Abdullah
LESSON OUTCOMES
2
Upon completion of this chapter, students should be able to:

▪ Define the UML


▪ Understand the use case diagram
▪ Understand the component of use case
▪ Understand the actors, use cases and relationship of the system

CSC186 OBJECT ORIENTED PROGRAMMING| JUHAIDA ISMAIL


UNIFIED MODELLING LANGUAGE -
INTRODUCTION

What?
Why?
Where?
UNIFIED MODELLING LANGUAGE -
INTRODUCTION (CONT…)

• What?
• A modeling language for visualizing, specifying,
constructing and documenting the artifacts of a
software system.

• Why?
• UML is a industry standard modeling language.

• Where?
• Design phase (most of the time).
5
USE CASE DIAGRAM

• Getting started is the most difficulty part of any new


process.
• In software modelling, the first thing you need to do is
understand what are you going to model and ultimately
develop.
• Creating a highest form details about a system--use case
diagram--is an almost natural point of origin for the
software design.
• A use case diagram is an excellent way to communicate
to management, customers, and other non-development
people what a system will do when it is completed.
6
UNIVERSITY RECORD SYSTEM
(URS)-EXAMPLE 1
• A University record system should keep
information about its students and academic staff.
• Records for all university members are to include
their id number, surname, given name, email,
address, date of birth, and telephone number.
• Students and academic staff each have their own
unique ID number: studN (students), acadN (academic
employee)
7
SOME ACTIONS SUPPORTED BY
URS
• The system should be able to handle the following
commands.
• Add and remove university members (students, and academic
staff)
• Add and Delete subjects
• Assign and Unassign subjects to students
• Assign and Unassign subjects to academic staff.
8
USE CASE DIAGRAMS DETAIL

• Use Case diagrams show the various activities the users


can perform on the system.
• System is something that performs a function.
• They model the dynamic aspects of the system.
• Provides a user’s perspective of the system.
9
USE CASE DIAGRAM - URS SYSTEM

URS
add member

del member

add subject academic


system
User/admin del subject

assg subject

unass subject

enrol subject student

unenrol subject
10
USE CASE DIAGRAMS COMPONENT

• A set of ACTORS : roles of users can play in


interacting with the system.
• An actor is used to represent something that
interacting to system.
• A set of USE CASES: each describes a possible
kind of interaction between an actor and the
system.
• Uses cases are actions that a user takes on a
system
• A number of RELATIONSHIPS between these
entities (Actors and Use Cases).
• Relationships are simply illustrated with a line
connecting actors to use cases.
11
USE CASE DIAGRAMS - ACTORS

• An actor is a user of the system playing a particular role.


• Actor is shown with a stick figure.

system academic student


User/admin
12
USE CASE DIAGRAMS – USE CASES

• Use case is a particular activity a user can do on the


system.
• Is represented by an ellipse.
• Following are two use cases for University Record
System(URS).

add member del subject


13
USE CASE DIAGRAMS –
RELATIONSHIPS
• Inclusion
• Inclusion enables to reuse one use case's steps
inside another use case.
• Extension
• Allows creating a new use case by adding steps to
existing use cases
• Generalization
• Allows child use cases to inherit behavior from
parent use cases
14 USE CASE – EXAMPLE (SELF SERVICE
MACHINE – INCLUDES & EXTENDS RELATIONSHIP)
<<includes>>
Open Machine
Restock

<<includes>>
Close Machine
<<extends>>

Restock According
to Sales
USE CASE – EXAMPLE (SELF SERVICE
MACHINE – GENERALIZE RELATIONSHIP):
15
ACTOR-TO-ACTOR RELATIONSHIP

generalized actor

Supplier Agent

specialized
actor

Restocker Collector
USE CASE DIAGRAM( EXAMPLE 2)-
16 LIBRARY SYSTEM
library system

borrow

client employee
reserve

Order title

Fine payment
supplier
USE CASE DIAGRAM(EXAMPLE 3) - STUDENT
17
GRADING SYSTEM

Grade system

Record
grades

Student
View grades

Teacher Distribute
Report cards

Create report
cards
Printing administrator
18 EXERCISE

The Khazanah Alam Sdn. Bhd. will organized the 5km fun run. The registration
of this fun run is free and the runner also entitled for free t-shirt. This
company request a system named Fun Run Management System(FRMS). This
system will allow a runner to do a self registered for 5km fun run by filling
their personal detail and t-shirt size. The organizer will shortlisted the detail
of the runner for administration purposes and it can be view by the runner. A
list of shirt quantities by size will be sent to the t-shirt supplier for the
ordering process. Write the use case diagram for the given requirements.
This use case diagram will identify the possible actor and use cases will be
involve in the FRMS.(This exercise is not involve the relationship element)

You might also like