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

CSC186 - 2) Basic OO Design Using UML (Part 1)

Uploaded by

2022623562
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

CSC186 - 2) Basic OO Design Using UML (Part 1)

Uploaded by

2022623562
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

CSC186

OBJECT ORIENTED
PROGRAMMING
Topic 2:
Basic OO Design using UML
(Part 1)
Topic Covered

◦ OOSE life cycle


◦ Use Case diagram and Use Case scenarios
◦ Class diagram
OOSE LIFE CYCLE
OBJECT-ORIENTED
SOFTWARE ENGINEERING
(OOSE)
Software Development Life Cycle

1. Analysis
2. Design
3. Implementation
4. Testing
5. Maintenance
OOSE
◦ Is a design technique that is used in software design in
object-oriented programming.

◦ Employs use cases and class diagram in software design.

◦ Replace the Flowchart/Pseudocode for the Object Oriented


System.
UML
UNIFIED MODELING
LANGUAGE
UML is a Language for Constructing

◦ UML – Unified Modeling Language


◦ Forward engineering
◦ Reverse engineering
◦ Round trip engineering

◦ UML addresses the specification of all important


decisions regarding:
◦ Analysis
◦ Design
◦ Implementation
Forward Engineering Example

Customer
class Customer
{
- cid private int cid;
- cname private String cname;
- mobile private String mobile;
private String email;
- email
public void purchase( ) { … }
+ purchase( ) public void login( ) { … }
+ login( ) public void logout( ) { … }
public void search( ) { … }
+ logout( )
}
+ search( )
Reverse Engineering Example

class Customer Customer


{
private int cid;
private String cname;
- cid
private String mobile; - cname
private String email; - mobile
public void purchase( ) { … }
- email
public void login( ) { … }
public void logout( ) { … } + purchase( )
public void search( ) { … } + login( )
} + logout( )
+ search( )
Roundtrip Engineering Example

Customer class Customer


{
- cid private int cid;
- cname private String cname;
- mobile private String mobile;
private String email;
- email
public void purchase( ) { … }
+ purchase( ) public void login( ) { … }
+ login( ) public void logout( ) { … }
public void search( ) { … }
+ logout( ) }
+ search( )
Example Of UML Diagrams
Behavioural Diagrams Structure Diagrams

◦ Use Case Diagram ◦ Class Diagram


◦ Activity Diagram ◦ Component Diagram
◦ State Machine Diagram ◦ Deployment Diagram
◦ Sequence Diagram ◦ Object Diagram
◦ Communication Diagram ◦ Package Diagram
◦ Interaction Overview Diagram ◦ Profile Diagram
◦ Timing Diagram ◦ Composite Structure Diagram
Tools to Draw UML Diagram
https://www.draw.io/

◦ Step:
1. Open the https://www.draw.io/
2. Choose UML
3. Choose the UML type
USE CASE DIAGRAM
Use Cases

◦ Use case is one of the classifiers in UML.

◦ An instance of use case is known as a scenario.

◦ Use case is graphically represented as a hollow ellipse.

◦ Use cases are connected to actors through associations.


Use Cases

◦ Specifies what the system does.

◦ Use case diagram contains:


1. Use cases
2. Actors
3. Associations, dependencies and generalizations
Use Cases – Example

Order product Library :: Make


Reservation

Simple Names Path Name


Validate user
Actors

◦ An actor is one which uses or interacts with the software system (subject).

◦ Actor can be a person or another system (logical or physical).

◦ Use case is always initiated by an actor by sending a message.

◦ Actor is graphically represented as a stickman or as a class symbol stereotyped


as actor.
Use Case Diagram – Example
Use Case Diagram – Example
Example - University Record
System (URS)
◦ A University record system should keep information about its students
and academic staff.
◦ Admin 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)
◦ In addition to the attributes mentioned above:
◦ Students will also have a list of subjects they are enrolled in. A
student cannot be enrolled in any more than 5 subjects.
◦ Academic employees will have a salary, and a list of subjects they
teach. An academic can teach no more than 2 subjects.
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 Un-assign subjects to students
◦ Assign and Un-assign subjects to academic staff.
Test Yourself 1

◦ From the given University Record System,


identify:
1. Actors
2. Possible activities (use case) for the actors.
Use Case Diagrams - Actors
◦ An actor is a user of the system playing a particular role.
◦ Actor is shown with a stick figure.

admin academic student


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 a URS system.

Add Delete
Test Yourself 2

◦ Draw the URS use case diagram using UML tool.


Use Case Diagram - URS
System URS
add member

del member
system choose subject
user/admin add subject academic
remove subject
del subject

assg subject

unass subject

enrol subject

student
unenrol subject
OTHER USE CASE
DIAGRAM EXAMPLE
Use Case Diagram – Example1
(Library) library system

borrow

client employee
reserve

Order title

Fine payment
supplier

A Library System.
Use Case Diagram for Student
Assessment Management System
Grade system

Record
grades

Student
View grades

Teacher Distribute
Report cards

Create report
cards
Printing administrator
END.
Thank you.

You might also like