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

Lab 2-1

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

Lab 2-1

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

Khawaja Fareed University of Engineering & Information Technology

Rahim Yar Khan

Department Of Computer Engineering

Software Design & Architecture Lab

Lab 01: Object-Oriented Design with UML

Lab Instructor: AISHA NASEER

Objective:

• What is UML
• Why the UML is necessary
• Modelling with Objects
Basic Concept:
The Unified Modeling Language (UML) is a visual modeling language that enables system
builders to create blueprints that capture their visions in a standard, easy-to-understand way, and
provides a mechanism to effectively share and communicate these visions with others. The
purpose of the diagrams is to present multiple views of a system; this set of multiple views is
called a model. UML model describes what a system is supposed to do. It doesn’t tell how to
implement the system

Design Phase:
Specifying the structure of how a software system will be written and function, without actually
writing the complete implementation. A transition from "what" the system must do, to "how" the
system will do it

1) What classes will we need to implement a system that meets our requirements?
2) What fields and methods will each class have?
3) How will the classes interact with each other?

CLASSES AND OBJECTS:


The data and functionality in an “object-oriented system is distributed among the objects that
exist while the system is running”. Each individual object maintains part of the system’s data and
provides a set of methods that permit other objects in the system to perform certain operations on
that data.
One of the hard tasks of object-oriented design is deciding how to split up a system’s data into a
set of objects that will interact successfully to support the required overall functionality.
For example: Anything in the class of washing machines has attributes such as brand name,
model, serial number, and capacity. Behaviors for things in this class include the operations
“accept clothes,” “accept detergent,” “turn on,” and “turn off.”

Common Examples of Object modeling with UML are:


1) Class diagram

Structural Things

Graphical notations used in structural things are most widely used in UML. These are considered
as the nouns of UML models. Following are the list of structural things.

 Classes
 Object
 Interface
 Collaboration
 Use case
 Active classes
 Components
 Nodes

Class Notation

UML class is represented by the following figure. The diagram is divided into four parts.

 The top section is used to name the class.


 The second one is used to show the attributes of the class.
 The third section is used to describe the operations performed by the class.
 The fourth section is optional to show any additional components.
Example 1: Class Diagram
Assignment 1:
Q1: Draw the class diagram for the following code make sure that each class is labeled
accurately?
Q2: Write a code for the given object diagram using the knowledge of the Example 2?

Note: Lab Assignment will be checked via plagiarism checker tool, therefore try to not
copy.

You might also like