0% found this document useful (0 votes)
89 views8 pages

CSC186 Lab Tutorial 3 OO Design Using UML With Draw - Io

This document discusses object-oriented programming and UML diagrams. It provides an overview of UML, explains why UML is used and describes different types of UML diagrams including class diagrams and use case diagrams. It then outlines steps to create UML diagrams using draw.io, an online diagramming tool, and provides examples of class and use case diagrams as lab exercises.

Uploaded by

Aina Zulkarnain
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
89 views8 pages

CSC186 Lab Tutorial 3 OO Design Using UML With Draw - Io

This document discusses object-oriented programming and UML diagrams. It provides an overview of UML, explains why UML is used and describes different types of UML diagrams including class diagrams and use case diagrams. It then outlines steps to create UML diagrams using draw.io, an online diagramming tool, and provides examples of class and use case diagrams as lab exercises.

Uploaded by

Aina Zulkarnain
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 8

CSC186

Object-Oriented Programming

LAB 3
OO Design using UML
with draw.io

Prepared by
Abdul Hadi bin Abdul Talip
Faculty of Computer and Mathematical Sciences
UiTM Sarawak

Prepared by Abdul Hadi bin Abdul Talip


Unified Modelling Language (UML)
The Unified Modelling Language (UML) is a graphical language for developing software
blueprints (models). UML is a standardized modelling language consisting of an integrated set
of diagrams, developed to help system and software developers for specifying, visualizing,
constructing, and documenting the artifacts of software systems.

Why we use UML


UML diagram helps to visualize, specify, construct, and document the artifacts of an object-
oriented system. By using visual representations, we can better understand possible flaws or
errors in software or business processes.

Types of UML Diagrams


There are several types of UML diagrams and each one of them serves a different purpose.
The two most broad categories that encompass all other types are the Structural UML
diagram and Behavioural UML diagram. Structural UML diagrams show how the system is
structured, including the classes, objects, packages, components, etc. in the system and the
relationships between those elements. Behavioural UML diagrams visualize how the system
behaves and interacts with itself and with users, other systems, and other entities. The
different types are broken down as follows:

Prepared by Abdul Hadi bin Abdul Talip


Class Diagram
Class diagrams are the most common diagrams used in UML. A class diagram in the Unified
Modelling Language (UML) is a type of static structure diagram that describes the structure
of a system by showing the system's classes, their attributes, operations (or methods), and
the relationships among objects.

Purpose of Class Diagram


1) Shows the static structure of classifiers in a system.
2) Diagram provides a basic notation for other structure diagrams prescribed by UML.
3) Helpful for developers and other team members too.

Use Case Diagram


Use case modelling (use case diagram) is a diagram that shows a set of use cases, actors and
their relationship. It describes what a system does or what is the functionality provided by
the system to benefit the users.

Purpose of Use Case Diagram


1) To give a clear and consistent description of what the system should do.
2) To provide a basis for conducting system tests to verify whether the system works
appropriately or not.
3) To provide the ability to transform functional requirements into classes and operations
in the system

Prepared by Abdul Hadi bin Abdul Talip


Draw UML diagram with draw.io
draw.io is a free online diagramming software application for building diagrams and charts.
The software allows you to choose from an automatic layout function, or create a custom
layout.

Step 1: Go to draw.io website at https://app.diagrams.net/. You may choose “Create New


Diagram” to start creating a new diagram from scratch. However, you may also choose “Open
Existing Diagram” if you have created any diagram using draw.io previously.

Step 2: Let say you want to create a new diagram, you may select to start either with a blank
diagram or with any specific template provided. To start creating a diagram, simply click on
the “Create” button.

Prepared by Abdul Hadi bin Abdul Talip


Step 3: Provide a suitable name for your diagram and click save.

Step 4: The main interface of draw.io page will be shown for you to get started.

Prepared by Abdul Hadi bin Abdul Talip


Step 5: On the left menu, you may select UML to find all elements related to the class diagram
and use case diagram. To use the element and put it on the layout page, just simply click on
the specific element.

Step 6: You may also edit the properties of the elements using the properties panel located
on the right side of the page.

Prepared by Abdul Hadi bin Abdul Talip


Step 7: Once the diagram is completed, you may export the diagram into several type of
image.

Prepared by Abdul Hadi bin Abdul Talip


Lab Exercise
Create the following Class Diagram and Use Case Diagram using draw.io.
a) Please draw a complete class diagram by adding at least one attribute and one method
for the class element based on the following diagram.

b) 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. An employee can only work in a department. There are two main
departments namely Academics and Admin departments. Your task is to model the
system for the company. Draw a class diagram which consists of all the classes including
their relationships, multiplicity specifications, and other model elements that you find
appropriate.

c) Please add another use case element named “validate user” in the use case diagram
below and create an include relationship to produce a proper use case diagram.

Prepared by Abdul Hadi bin Abdul Talip

You might also like