Chapter 5 Oop Final
Chapter 5 Oop Final
BY
Mujahid Jemal (MSc)
Lecturer at Department of Electrical &Electronics Technology
and ATTC Registrar
e-mail : [email protected]
09-Aug-23 1
Outline
Object-Oriented Design Methodologies
09-Aug-23 2
Object-Oriented Design Methodologies
The general cycle that a programmer goes through to solve a
programming problem:
Formulate the problem - The programmer must
completely understand the problem.
Analyze the problem - The programmer must find the
important concepts of the problem.
Design - The programmer must design a solution based on
the analysis.
Code - Finally the programmer writes the code to
implement the design.
• The Waterfall Model, as illustrated in Fig. below, is a linear
sequential model that begins with definition and ends with
system operation and maintenance.
09-Aug-23 3
09-Aug-23 4
The seven phases in the process as shown in Fig.above are:
i.Requirements Definition:
The customer must define the requirements to allow the
developer to understand what is required of the software
system.
If this development is part of a larger system, then other
development teams must communicate to develop system
interfaces.
09-Aug-23 5
ii. Analysis:
iii. Design:
09-Aug-23 6
iv. Coding:
The design is now coded, requiring quality assurance of
inspection, unit testing and integration testing.
v. System Tests:
Once the coding phase is complete, system tests are performed
to locate as many software errors as possible.
This is carried out by developer before the software is passed
to the client.
The client may carry out further tests, or carry out joint tests
with the developer.
09-Aug-23 7
vi. Installation and Conversion:
The software system is installed.
09-Aug-23 8
vii. Operation and Maintenance:
Software operation begins once it is installed on the client site.
09-Aug-23 9
The Waterfall Model is a general model, where in small
projects some of the phases can be dropped.
In large scale software development projects some of these
phases may be split into further phases.
At the end of each phase the outcome is evaluated and if it is
approved then development can progress to the next phase.
If the evaluation is rejected, then the last phase must be
revisited and in some cases earlier phases may need to be
examined.
09-Aug-23 10
Introduction to Unified Modeling
Language (UML)
UML:
• UML stands for Unified Modelling Language
• Unified modelling language (UML) is a standardized
modelling language enabling developers to specify, visualize,
construct and document artefacts of a software system.
• UML is an important aspect involved in object-oriented
software development.
• It uses graphic notation to create visual models of software
systems.
• UML was created by the Object Management Group (OMG)
and UML 1.0 specification draft was proposed to the OMG in
January 1997.
09-Aug-23 11
• OMG is continuously making efforts to create a truly industry
standard.
• UML is different from the other common programming
languages such as C++, Java, COBOL, etc.
• UML is a pictorial language used to make software blueprints.
• Although UML is generally used to model software systems, it
is not limited within this boundary.
• It is also used to model non-software systems as well.
For example, the process flow in a manufacturing unit, etc.
09-Aug-23 12
• UML is not a programming language but tools can be used to
generate code in various languages using UML diagrams.
09-Aug-23 13
OO concepts in UML & Types of UML
diagrams
To understand the conceptual model of UML, first we need to
clarify what is a conceptual model? and why a conceptual
model is required?
A conceptual model can be defined as a model which is made
of concepts and their relationships.
A conceptual model is the first step before drawing a UML
diagram.
It helps to understand the entities in the real world and how
they interact with each other.
As UML describes the real-time systems, it is very important
to make a conceptual model and then proceed gradually.
09-Aug-23 14
UML Diagrams
Class diagram:
A class is a rectangle divided into three parts
i.Class name in top of box
- It is printed in bold and centered, and the first letter is capitalized.
ii. Class attributes (i.e. data members, variables)
- They are left-aligned and the first letter is lowercase.
iii. Class operations (i.e. methods)
- They are also left-aligned and the first letter is lowercase.
09-Aug-23 15
Class attributes (= fields)
Attributes (fields, instance variables)
visibility name : type [count] = default value
Visibility:
+ public
# protected
- private
~ package (default)
/ derived
Example: - balance : double = 0.00
09-Aug-23 16
Operations / methods
Visibility name (parameters) : return type
Omit return type on constructors and when return type is void
Parameter types listed as (name: type)
Example:
+ distance (p1: Point, p2: Point): double
09-Aug-23 17
09-Aug-23 18
Generalization/Inheritance
• Generalization is the relationship between a class (superclass)
and one or more variations of the class (subclasses).
• Generalization organizes classes by their similarities and their
differences, structuring the descriptions of objects.
• A superclass holds common attributes, attributes and
associations.
• The subclasses adds specific attributes, operations, and
associations.
• They inherit the features of their superclass.
• Often Generalization is called a “IS A” relationship
• Simple generalization organizes classes into a hierarchy.
09-Aug-23 19
09-Aug-23 20
Object Diagrams
• Format is
– Instance name : Class name
– Attributes = Values
09-Aug-23 21
09-Aug-23 22