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

OOP Vs OOD

Uploaded by

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

OOP Vs OOD

Uploaded by

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

Object Oriented

Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Object Oriented Analysis and Design Design

Software Design
Tools

Object Oriented
Fundamentals of (Object-Oriented) Software Design Programming
Concepts

Basics of Object
Oriented Analysis
and Design
Lecture 01-02 Quality Design
Concepts
Object Oriented
Agenda Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction Introduction

Types of Software
Design
Types of Software Design Software Design
Tools

Object Oriented
Software Design Tools Programming
Concepts

Basics of Object
Oriented Analysis
Object Oriented Programming Concepts and Design

Quality Design
Concepts
Basics of Object Oriented Analysis and Design

Quality Design Concepts


Object Oriented
Agenda Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction Introduction

Types of Software
Design
Types of Software Design Software Design
Tools

Object Oriented
Software Design Tools Programming
Concepts

Basics of Object
Oriented Analysis
Object Oriented Programming Concepts and Design

Quality Design
Concepts
Basics of Object Oriented Analysis and Design

Quality Design Concepts


Object Oriented
Object Oriented Programming vs Design Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

I Object oriented programming is about using object Software Design


Tools
oriented language features Object Oriented
I Object oriented design is about leveraging object Programming
Concepts
oriented principles to make your design more effective Basics of Object
I writing a code which is maintainable, ensures Oriented Analysis
and Design
transparency, and is simplistic
Quality Design
Concepts
Object Oriented
Software Analysis and Design Analysis and
Design

Analysis and Design are first two phases in software Fundamentals of


(OO) Software
development life cycle Design

I Analysis Introduction

I Design Types of Software


Design
I Coding Software Design
I Testing Tools

I Maintenance Object Oriented


Programming
Concepts

Basics of Object
Oriented Analysis
and Design

Quality Design
Concepts

Figure: SDLC
Object Oriented
Analysis Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I Analysis emphasizes an investigation of the problem and
Software Design
requirements, rather than a solution. Tools
I For example, if a new computerized library information Object Oriented
Programming
system is desired, how will it be used? Concepts

I Requirements analysis (an investigation of the Basics of Object


Oriented Analysis
requirements) and Design

I Object analysis (an investigation of the domain objects) Quality Design


Concepts
Object Oriented
Analysis Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I Analysis emphasizes an investigation of the problem and
Software Design
requirements, rather than a solution. Tools
I For example, if a new computerized library information Object Oriented
Programming
system is desired, how will it be used? Concepts

I Requirements analysis (an investigation of the Basics of Object


Oriented Analysis
requirements) and Design

I Object analysis (an investigation of the domain objects) Quality Design


Concepts
Object Oriented
Design Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I Design emphasizes a conceptual solution that fulfills the Software Design
Tools
requirements, rather than its implementation
Object Oriented
I It explains the idea/concept of something usually with Programming
Concepts
graphical diagrams Basics of Object
Oriented Analysis
I The design is a representation of a product or a system and Design
with sufficient detail for implementation Quality Design
Concepts
Object Oriented
Software Design Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
I Software design is a process to transform user Design

requirements into some suitable form, which helps the Software Design
Tools
programmer in software coding and implementation Object Oriented
I Design is a meaningful representation of something that Programming
Concepts
is to be built Basics of Object
Oriented Analysis
I Design is driven by known solutions, which increases and Design

performance by allowing a user to dynamically shift Quality Design


Concepts
goals and activities
Object Oriented
Software Design Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
I Software design is a process to transform user Design

requirements into some suitable form, which helps the Software Design
Tools
programmer in software coding and implementation Object Oriented
I Design is a meaningful representation of something that Programming
Concepts
is to be built Basics of Object
Oriented Analysis
I Design is driven by known solutions, which increases and Design

performance by allowing a user to dynamically shift Quality Design


Concepts
goals and activities
Object Oriented
Software Design Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

Without Software Design Software Design


Tools
I We risk building an unstable system Object Oriented
Programming
I one that will fail when small changes are made Concepts

I one that will be of no or very little use for similar Basics of Object
Oriented Analysis
projects (not reusable) and Design

Quality Design
Concepts
Object Oriented
Agenda Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction Introduction

Types of Software
Design
Types of Software Design Software Design
Tools

Object Oriented
Software Design Tools Programming
Concepts

Basics of Object
Oriented Analysis
Object Oriented Programming Concepts and Design

Quality Design
Concepts
Basics of Object Oriented Analysis and Design

Quality Design Concepts


Object Oriented
Types of Software design – 1 Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Interface Design Design

I Interface design is the specification of the interaction Software Design


Tools
between a system and its environment. This phase Object Oriented
proceeds at a high level of abstraction with respect to Programming
Concepts
the inner workings of the system Basics of Object
Oriented Analysis
I Interface design describes how the software and Design

communicates with systems that interoperate with it Quality Design


Concepts
and with humans who use it
Object Oriented
Types of Software design – 2 Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
Architectural Design
Software Design
I Architectural design is the specification of the major Tools

components of a system, their responsibilities, Object Oriented


Programming
properties, interfaces, and the relationships and Concepts

interactions between them. In architectural design, the Basics of Object


Oriented Analysis
overall structure of the system is chosen, but the and Design

Quality Design
internal details of major components are ignored Concepts
Object Oriented
Types of Software design – 3 Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

Software Design
Detailed Design/Component-level design Tools

I Design is the specification of the internal elements of all Object Oriented


Programming
major system components, their properties, Concepts

relationships, processing, and often their algorithms and Basics of Object


Oriented Analysis
the data structures and Design

Quality Design
Concepts
Object Oriented
Agenda Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction Introduction

Types of Software
Design
Types of Software Design Software Design
Tools

Object Oriented
Software Design Tools Programming
Concepts

Basics of Object
Oriented Analysis
Object Oriented Programming Concepts and Design

Quality Design
Concepts
Basics of Object Oriented Analysis and Design

Quality Design Concepts


Object Oriented
Software Design Tools – 1 Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

Software Design
I Data Flow Diagram (DFD) Tools

Object Oriented
I Data flow diagram is graphical representation of flow of Programming
Concepts
data in an information system. It is capable of depicting
Basics of Object
incoming data flow, outgoing data flow and stored data. Oriented Analysis
and Design

Quality Design
Concepts
Object Oriented
Software Design Tools – 1 Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction
I Data Flow Diagram (DFD) Types of Software
I Data flow diagram is graphical representation of flow of Design

data in an information system. It is capable of depicting Software Design


Tools
incoming data flow, outgoing data flow and stored data.
Object Oriented
Programming
Concepts

Basics of Object
Oriented Analysis
and Design

Quality Design
Concepts
Figure: 0-Level DFD
Object Oriented
Software Design Tools – 2 Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I HIPO Diagram Software Design
I HIPO diagram represents the hierarchy of modules in Tools

Object Oriented
the software system. Analyst uses HIPO diagram in Programming
order to obtain high-level view of system functions. It Concepts

decomposes functions into sub-functions in a Basics of Object


Oriented Analysis
hierarchical manner. It depicts the functions performed and Design
by system. Quality Design
Concepts
Object Oriented
Software Design Tools – 2 Analysis and
Design

I HIPO Diagram Fundamentals of


(OO) Software
I HIPO diagram represents the hierarchy of modules in Design

the software system. Analyst uses HIPO diagram in Introduction


order to obtain high-level view of system functions. It
Types of Software
decomposes functions into sub-functions in a Design
hierarchical manner. It depicts the functions performed Software Design
Tools
by system.
Object Oriented
Programming
Concepts

Basics of Object
Oriented Analysis
and Design

Quality Design
Concepts

Figure: HIPO Diagram


Object Oriented
Software Design Tools – 3 Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction
I Entity-Relationship Model
Types of Software
I UML Design

I Structured Diagrams Software Design


Tools
I Class Diagram
Object Oriented
I Component Diagram Programming
I Object Diagram Concepts

I Data Model Basics of Object


Oriented Analysis
I Behavior Diagrams and Design

I Use Case Diagram Quality Design


Concepts
I Activity Diagram
I State Machine Diagram
I Sequence Diagram
Object Oriented
Software Design Tools – 3 Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction
I Entity-Relationship Model
Types of Software
I UML Design

I Structured Diagrams Software Design


Tools
I Class Diagram
Object Oriented
I Component Diagram Programming
I Object Diagram Concepts

I Data Model Basics of Object


Oriented Analysis
I Behavior Diagrams and Design

I Use Case Diagram Quality Design


Concepts
I Activity Diagram
I State Machine Diagram
I Sequence Diagram
Object Oriented
Agenda Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction Introduction

Types of Software
Design
Types of Software Design Software Design
Tools

Object Oriented
Software Design Tools Programming
Concepts

Basics of Object
Oriented Analysis
Object Oriented Programming Concepts and Design

Quality Design
Concepts
Basics of Object Oriented Analysis and Design

Quality Design Concepts


Object Oriented
Object and Classes Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I Object is a real world physical entity Software Design
Tools
I It can be quantified to mean one specific item
Object Oriented
I Objects have physical existence Programming
Concepts
I Class is a template which represents all objects of same
Basics of Object
kind e.g., human being Oriented Analysis
and Design
I Class have logical existence
Quality Design
Concepts
Object Oriented
Attributes and Methods Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

Software Design
Tools
I Attribute stores information about an instance Object Oriented
Programming
I Behaviors are the tasks that an object performs, Concepts

methods are used for this purpose Basics of Object


Oriented Analysis
and Design

Quality Design
Concepts
Object Oriented
Encapsulation and Information Hiding Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I By Information Hiding we mean “showing only those
Software Design
details to the outside world which are necessary for the Tools

outside world and hiding all other details from the Object Oriented
Programming
outside world.” Concepts

I Encapsulation means “we have enclosed all the Basics of Object


Oriented Analysis
characteristics of the object in the object itself” and Design

Quality Design
I Information hiding is achieved using encapsulation Concepts
Object Oriented
Implementation Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I It is actual implementation of the behavior of the object Software Design
Tools
in any object oriented language
Object Oriented
I Internal data structures to hold an object state that will Programming
Concepts
be hidden from us it will store values for an object data
members Basics of Object
Oriented Analysis
I Functionality in the form of member functions to and Design

provide required behavior Quality Design


Concepts
Object Oriented
Association, Composition, and Aggregation Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

I Interaction of different objects in OO model (or in Software Design


Tools
problem domain) is known as association Object Oriented
I It can be of one of the following types Programming
Concepts
I Simple association Basics of Object
I Composition Oriented Analysis
and Design
I Aggregation
Quality Design
Concepts
Object Oriented
Association, Composition, and Aggregation Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
Simple Association
Software Design
I The two interacting objects have no intrinsic Tools

relationship with other object Object Oriented


Programming
I It is the weakest link between objects Concepts

Basics of Object
Oriented Analysis
and Design

Quality Design
Concepts
Object Oriented
Association, Composition, and Aggregation Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
Composition (consists of)
Software Design
I Life cycle of an object is dependent on the other object Tools

Object Oriented
I An object is born and destroyed with the other object Programming
Concepts
I Composition is a stronger relationship, because Basics of Object
Oriented Analysis
Composed object becomes a part of the composer and Design

I Composed object can’t exist independently Quality Design


Concepts
Object Oriented
Association, Composition, and Aggregation Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction
Composition (consists of) Types of Software
Design
I Life cycle of an object is dependent on the other object
Software Design
I An object is born and destroyed with the other object Tools

Object Oriented
I Composition is a stronger relationship, because Programming
Concepts
Composed object becomes a part of the composer Basics of Object
I Composed object can’t exist independently Oriented Analysis
and Design

Quality Design
Concepts
Object Oriented
Association, Composition, and Aggregation Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

Aggregation (has a) Software Design


Tools
I An object may contain a collection (aggregate) of other Object Oriented
Programming
objects Concepts

I Life cycle of an object is not dependent on the other Basics of Object


Oriented Analysis
I Aggregated object can exist independently and Design

Quality Design
Concepts
Object Oriented
Association, Composition, and Aggregation Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Aggregation (has a) Types of Software


Design
I An object may contain a collection (aggregate) of other Software Design
Tools
objects
Object Oriented
I Life cycle of an object is not dependent on the other Programming
Concepts
I Aggregated object can exist independently Basics of Object
Oriented Analysis
and Design

Quality Design
Concepts
Object Oriented
Inheritance Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction
I A child inherits characteristics of its parents, besides Types of Software
Design
inherited characteristics, a child may have its own
Software Design
unique characteristics Tools

I Inheritance is the process of creating new classes, called Object Oriented


Programming
Concepts
derived classes, from existing or base classes.
Basics of Object
I The derived class inherits all the capabilities of the base Oriented Analysis
and Design
class but can add embellishments and refinements of its Quality Design
own Concepts

I The base class is unchanged by this process


Object Oriented
Inheritance Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

Software Design
Tools

Object Oriented
Programming
Concepts

Basics of Object
Oriented Analysis
and Design

Quality Design
Concepts
Object Oriented
Polymorphism Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

Software Design
I Polymorphism means that different objects can behave Tools

Object Oriented
in different ways for the same message (stimulus). Programming
Concepts
I Consequently, sender of a message does not need to
Basics of Object
know exact class of the receiver Oriented Analysis
and Design

Quality Design
Concepts
Object Oriented
Polymorphism Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

Software Design
Tools

Object Oriented
Programming
Concepts

Basics of Object
Oriented Analysis
and Design

Quality Design
Concepts
Object Oriented
Agenda Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction Introduction

Types of Software
Design
Types of Software Design Software Design
Tools

Object Oriented
Software Design Tools Programming
Concepts

Basics of Object
Oriented Analysis
Object Oriented Programming Concepts and Design

Quality Design
Concepts
Basics of Object Oriented Analysis and Design

Quality Design Concepts


Object Oriented
OO Software Process Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

I OO software process is to break your programs up into Software Design


Tools
independent self-sufficient objects Object Oriented
I There are three stages of OO process Programming
Concepts
I Object oriented analysis (OOA) Basics of Object
I Object oriented design (OOD) Oriented Analysis
and Design
I Object oriented programming (OOP)
Quality Design
Concepts
Object Oriented
OO Software Process Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

I OO software process is to break your programs up into Software Design


Tools
independent self-sufficient objects Object Oriented
I There are three stages of OO process Programming
Concepts
I Object oriented analysis (OOA) Basics of Object
I Object oriented design (OOD) Oriented Analysis
and Design
I Object oriented programming (OOP)
Quality Design
Concepts
Object Oriented
Three stages of the OO process Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I OOA - how to arrange a collection of classes to best
Software Design
representing your real-world problem in a format which Tools

a computer program finds easy to deal with. What Object Oriented


Programming
kinds of data and methods go into your classes Concepts

I OOD How the classes relate to each other.represent Basics of Object


Oriented Analysis
them in the form a (class, object, sequence) diagram and Design

Quality Design
I OOP is about making the class implementations work Concepts
Object Oriented
Three stages of the OO process Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I OOA - how to arrange a collection of classes to best
Software Design
representing your real-world problem in a format which Tools

a computer program finds easy to deal with. What Object Oriented


Programming
kinds of data and methods go into your classes Concepts

I OOD How the classes relate to each other.represent Basics of Object


Oriented Analysis
them in the form a (class, object, sequence) diagram and Design

Quality Design
I OOP is about making the class implementations work Concepts
Object Oriented
Three stages of the OO process Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I OOA - how to arrange a collection of classes to best
Software Design
representing your real-world problem in a format which Tools

a computer program finds easy to deal with. What Object Oriented


Programming
kinds of data and methods go into your classes Concepts

I OOD How the classes relate to each other.represent Basics of Object


Oriented Analysis
them in the form a (class, object, sequence) diagram and Design

Quality Design
I OOP is about making the class implementations work Concepts
Object Oriented
Object Oriented Analysis (OOA) Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I Identifying classes, attributes, and methods from
Software Design
problem statements Tools
I The nouns are likely to be either classes or member Object Oriented
Programming
fields of classes. The verbs are likely to be class Concepts
methods. Basics of Object
I Think about how best to group the nouns into classes, Oriented Analysis
and Design
and about which class should be responsible for which
Quality Design
action Concepts
Object Oriented
Object Oriented Analysis (OOA) Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I Identifying classes, attributes, and methods from
Software Design
problem statements Tools
I The nouns are likely to be either classes or member Object Oriented
Programming
fields of classes. The verbs are likely to be class Concepts
methods. Basics of Object
I Think about how best to group the nouns into classes, Oriented Analysis
and Design
and about which class should be responsible for which
Quality Design
action Concepts
Object Oriented
Object Oriented Analysis (OOA) Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I Identifying classes, attributes, and methods from
Software Design
problem statements Tools
I The nouns are likely to be either classes or member Object Oriented
Programming
fields of classes. The verbs are likely to be class Concepts
methods. Basics of Object
I Think about how best to group the nouns into classes, Oriented Analysis
and Design
and about which class should be responsible for which
Quality Design
action Concepts
Object Oriented
Object Oriented Analysis (OOA) Analysis and
Design

Fundamentals of
(OO) Software
Design
Example
Introduction
I Access Control System - We have a task to design
Types of Software
and implement an access control system for a company Design

with more than 100 staffs and 5 functional Software Design


Tools
departments. The access control system is used to Object Oriented
Programming
control the access to the doors in the office areas of the Concepts
company. Staff members are authorized to have access Basics of Object
Oriented Analysis
to the doors Depending on the staff’s authority, he/she and Design
can access to some doors. The accessibility also Quality Design
Concepts
depends on the day and time, for example, certain doors
are accessible only during the weekdays. Staff members
can also take a leave. When a staff is on leave he/she is
not accessible to any door.
Object Oriented
Object Oriented Analysis (OOA) Analysis and
Design

Fundamentals of
(OO) Software
Design
Example
I Access Control System - We have a task to design Introduction

Types of Software
and implement an access control system for a Design
company with more than 100 staffs and 5 functional Software Design
Tools
departments . The access control system is used to Object Oriented
Programming
control the access to the doors in the office areas of Concepts

the company . Staff members are authorized to have Basics of Object


Oriented Analysis
access to the doors. Depending on the staff’s authority, and Design

he/she can access to some doors. The accessibility Quality Design


Concepts
also depends on the day and time , for example, certain
doors are accessible only during the weekdays. Staff
members can also take a leave . When a staff is on
leave he/she is not accessible to any door.
Object Oriented
Object Oriented Analysis (OOA) Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

Example Software Design


Tools
I Nouns: staff, department, door, company, authority, Object Oriented
Programming
day and time, leave. Concepts

I Actions: access, authorize, take leave. Basics of Object


Oriented Analysis
and Design
.
Quality Design
Concepts
Object Oriented
Object Oriented Analysis (OOA) Analysis and
Design

Fundamentals of
(OO) Software
Design
Example
Introduction

Types of Software
Design

Software Design
Tools

Object Oriented
Programming
Concepts

Basics of Object
Oriented Analysis
and Design

Quality Design
Concepts
Object Oriented
Object Oriented Design (OOD) Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

Software Design
Tools

How the classes relate to each other. Represent them in the Object Oriented
Programming
form a (class, object, sequence) diagram Concepts

Basics of Object
Oriented Analysis
and Design

Quality Design
Concepts
Object Oriented
Object Oriented Design (OOD) Analysis and
Design

Fundamentals of
(OO) Software
Design
Example
Introduction

Types of Software
Design

Software Design
Tools

Object Oriented
Programming
Concepts

Basics of Object
Oriented Analysis
and Design

Quality Design
Concepts
Object Oriented
Agenda Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction Introduction

Types of Software
Design
Types of Software Design Software Design
Tools

Object Oriented
Software Design Tools Programming
Concepts

Basics of Object
Oriented Analysis
Object Oriented Programming Concepts and Design

Quality Design
Concepts
Basics of Object Oriented Analysis and Design

Quality Design Concepts


Object Oriented
Quality Design Concepts Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I Abstraction
Software Design
I Refinement Tools

Object Oriented
I Modularity Programming
Concepts
I Information Hiding Basics of Object
Oriented Analysis
I Cohesion and Design

I Coupling Quality Design


Concepts
Object Oriented
Abstraction Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design

I Abstraction permits one to concentrate on a problem at Software Design


Tools
some level of generalization without regard to irrelevant Object Oriented
Programming
low-level details Concepts

I Abstraction is one of the fundamental ways that we as Basics of Object


Oriented Analysis
humans cope with complexity (Grady Booch) and Design

Quality Design
Concepts
Object Oriented
Abstraction Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction
Levels of Abstraction
Types of Software
I At the highest level of abstraction, a solution is stated Design

in broad terms using the language of the problem Software Design


Tools
environment Object Oriented
Programming
I At lower levels of abstraction, a more procedural Concepts
orientation is taken Basics of Object
I Problem-oriented terminology is coupled with Oriented Analysis
and Design
implementation-oriented terminology in an effort to Quality Design
state a solution Concepts

I At the lowest level of abstraction, the solution is stated


in a manner that can be directly implemented
Object Oriented
Abstraction Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction
Levels of Abstraction
Types of Software
I At the highest level of abstraction, a solution is stated Design

in broad terms using the language of the problem Software Design


Tools
environment Object Oriented
Programming
I At lower levels of abstraction, a more procedural Concepts
orientation is taken Basics of Object
I Problem-oriented terminology is coupled with Oriented Analysis
and Design
implementation-oriented terminology in an effort to Quality Design
state a solution Concepts

I At the lowest level of abstraction, the solution is stated


in a manner that can be directly implemented
Object Oriented
Abstraction Analysis and
Design

Fundamentals of
(OO) Software
Design

Types of Abstraction Introduction

I Procedural abstraction Types of Software


Design
I Named sequence of instructions that has a specific and
Software Design
limited function Tools
I Example: Open door Object Oriented
Programming
I Data abstraction Concepts

I Named collection of data that describes a data object Basics of Object


Oriented Analysis
I Example: any object (ADT) and Design

I Control abstraction Quality Design


Concepts
I Implies a program control mechanism without specifying
internal details
I Example: synchronization semaphore
Object Oriented
Abstraction Analysis and
Design

Fundamentals of
(OO) Software
Design

Types of Abstraction Introduction

I Procedural abstraction Types of Software


Design
I Named sequence of instructions that has a specific and
Software Design
limited function Tools
I Example: Open door Object Oriented
Programming
I Data abstraction Concepts

I Named collection of data that describes a data object Basics of Object


Oriented Analysis
I Example: any object (ADT) and Design

I Control abstraction Quality Design


Concepts
I Implies a program control mechanism without specifying
internal details
I Example: synchronization semaphore
Object Oriented
Abstraction Analysis and
Design

Fundamentals of
(OO) Software
Design

Types of Abstraction Introduction

I Procedural abstraction Types of Software


Design
I Named sequence of instructions that has a specific and
Software Design
limited function Tools
I Example: Open door Object Oriented
Programming
I Data abstraction Concepts

I Named collection of data that describes a data object Basics of Object


Oriented Analysis
I Example: any object (ADT) and Design

I Control abstraction Quality Design


Concepts
I Implies a program control mechanism without specifying
internal details
I Example: synchronization semaphore
Object Oriented
Refinement Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

I A program is developed by successively refining levels of Types of Software


Design
procedural detail Software Design
Tools
I A hierarchy is developed decomposing a macroscopic
Object Oriented
statement of function in a stepwise fashion until Programming
Concepts
programming language statements are reached Basics of Object
Oriented Analysis
I Refinement is actually a process of elaboration and Design

I Perform stepwise refinement Quality Design


Concepts
I Abstraction and refinement are complementary concepts
Object Oriented
Refinement Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

I A program is developed by successively refining levels of Types of Software


Design
procedural detail Software Design
Tools
I A hierarchy is developed decomposing a macroscopic
Object Oriented
statement of function in a stepwise fashion until Programming
Concepts
programming language statements are reached Basics of Object
Oriented Analysis
I Refinement is actually a process of elaboration and Design

I Perform stepwise refinement Quality Design


Concepts
I Abstraction and refinement are complementary concepts
Object Oriented
Modularity Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I One of the oldest concepts in software design Software Design
Tools
I Software is divided into separately named and
Object Oriented
addressable components, often called, modules, that are Programming
Concepts
integrated to satisfy problem requirements Basics of Object
Oriented Analysis
I Don’t over modularize. The simplicity of each module and Design
will be overshadowed by the complexity of integration Quality Design
Concepts
Object Oriented
Modularity Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I One of the oldest concepts in software design Software Design
Tools
I Software is divided into separately named and
Object Oriented
addressable components, often called, modules, that are Programming
Concepts
integrated to satisfy problem requirements Basics of Object
Oriented Analysis
I Don’t over modularize. The simplicity of each module and Design
will be overshadowed by the complexity of integration Quality Design
Concepts
Object Oriented
Information Hiding – 1 Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
I Modules should be specified and designed so that Design

information (procedures and data) contained within a Software Design


Tools
module is inaccessible to other modules that have no Object Oriented
need for such information Programming
Concepts
I IH means that effective modularity can be achieved by Basics of Object
Oriented Analysis
defining a set of independent modules that and Design

communicate with one another only that information Quality Design


Concepts
necessary to achieve a software function
Object Oriented
Information Hiding – 1 Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
I Modules should be specified and designed so that Design

information (procedures and data) contained within a Software Design


Tools
module is inaccessible to other modules that have no Object Oriented
need for such information Programming
Concepts
I IH means that effective modularity can be achieved by Basics of Object
Oriented Analysis
defining a set of independent modules that and Design

communicate with one another only that information Quality Design


Concepts
necessary to achieve a software function
Object Oriented
Information Hiding – 2 Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I The greatest benefits of IH are achieved when
Software Design
modifications are required during testing and later, Tools

during software maintenance Object Oriented


Programming
Concepts
I Both data and procedures are hidden from other parts
Basics of Object
of the software, inadvertent errors introduced Oriented Analysis
and Design
modifications are less likely to propagate to other
Quality Design
locations within the software Concepts
Object Oriented
Cohesion Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
I Cohesion is the qualitative indication of the degree to Design

Software Design
which a module focuses on just one thing Tools

I A cohesive module performs one single task or is Object Oriented


Programming
focused on one thing Concepts

Basics of Object
I Highly cohesive modules are better, however, mid-range Oriented Analysis
and Design
cohesion is acceptable
Quality Design
I Low-end cohesion is very bad Concepts
Object Oriented
Cohesion Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
I Cohesion is the qualitative indication of the degree to Design

Software Design
which a module focuses on just one thing Tools

I A cohesive module performs one single task or is Object Oriented


Programming
focused on one thing Concepts

Basics of Object
I Highly cohesive modules are better, however, mid-range Oriented Analysis
and Design
cohesion is acceptable
Quality Design
I Low-end cohesion is very bad Concepts
Object Oriented
Cohesion Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
I Cohesion is the qualitative indication of the degree to Design

Software Design
which a module focuses on just one thing Tools

I A cohesive module performs one single task or is Object Oriented


Programming
focused on one thing Concepts

Basics of Object
I Highly cohesive modules are better, however, mid-range Oriented Analysis
and Design
cohesion is acceptable
Quality Design
I Low-end cohesion is very bad Concepts
Object Oriented
Cohesion Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Types of Cohesion (Undesirable) Design

I Coincidental cohesion occurs when unrelated Software Design


Tools
components of a system are bundled together Object Oriented
I Logical cohesion occurs when components performing Programming
Concepts
similar functions are put together even though they are Basics of Object
Oriented Analysis
different by nature (e.g., error handling) and Design

I Temporal cohesion occurs when components that are Quality Design


Concepts
activated at a single time or time span are put together
Object Oriented
Cohesion Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Types of Cohesion (Undesirable) Design

I Coincidental cohesion occurs when unrelated Software Design


Tools
components of a system are bundled together Object Oriented
I Logical cohesion occurs when components performing Programming
Concepts
similar functions are put together even though they are Basics of Object
Oriented Analysis
different by nature (e.g., error handling) and Design

I Temporal cohesion occurs when components that are Quality Design


Concepts
activated at a single time or time span are put together
Object Oriented
Cohesion Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Types of Cohesion (Undesirable) Design

I Coincidental cohesion occurs when unrelated Software Design


Tools
components of a system are bundled together Object Oriented
I Logical cohesion occurs when components performing Programming
Concepts
similar functions are put together even though they are Basics of Object
Oriented Analysis
different by nature (e.g., error handling) and Design

I Temporal cohesion occurs when components that are Quality Design


Concepts
activated at a single time or time span are put together
Object Oriented
Cohesion Analysis and
Design

Fundamentals of
(OO) Software
Types of Cohesion (Acceptable) Design

I Procedural cohesion occurs when the elements in a Introduction

component always follow a certain sequence of Types of Software


Design
execution (e.g., a function which checks file permissions Software Design
and then opens the file) Tools

Object Oriented
I Communicational cohesion occurs when all elements Programming
Concepts
of a component operate on the same input data,
Basics of Object
produce the same output data, or operate on one area Oriented Analysis
and Design
of a data structure (e.g., update record in database and
Quality Design
log that) Concepts

I Sequential cohesion occurs when the output of one


element in a component serves an input for another
element (e.g., a function which reads data from a file
and processes the data)
Object Oriented
Cohesion Analysis and
Design

Fundamentals of
(OO) Software
Types of Cohesion (Acceptable) Design

I Procedural cohesion occurs when the elements in a Introduction

component always follow a certain sequence of Types of Software


Design
execution (e.g., a function which checks file permissions Software Design
and then opens the file) Tools

Object Oriented
I Communicational cohesion occurs when all elements Programming
Concepts
of a component operate on the same input data,
Basics of Object
produce the same output data, or operate on one area Oriented Analysis
and Design
of a data structure (e.g., update record in database and
Quality Design
log that) Concepts

I Sequential cohesion occurs when the output of one


element in a component serves an input for another
element (e.g., a function which reads data from a file
and processes the data)
Object Oriented
Cohesion Analysis and
Design

Fundamentals of
(OO) Software
Types of Cohesion (Acceptable) Design

I Procedural cohesion occurs when the elements in a Introduction

component always follow a certain sequence of Types of Software


Design
execution (e.g., a function which checks file permissions Software Design
and then opens the file) Tools

Object Oriented
I Communicational cohesion occurs when all elements Programming
Concepts
of a component operate on the same input data,
Basics of Object
produce the same output data, or operate on one area Oriented Analysis
and Design
of a data structure (e.g., update record in database and
Quality Design
log that) Concepts

I Sequential cohesion occurs when the output of one


element in a component serves an input for another
element (e.g., a function which reads data from a file
and processes the data)
Object Oriented
Cohesion Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Types of Cohesion (Desirable) Design

I Functional cohesion occurs when each part of a Software Design


Tools
component is necessary for the execution of a single Object Oriented
function (e.g., read transaction record) Programming
Concepts
I Object cohesion occurs when the functions of a Basics of Object
Oriented Analysis
common class of objects are aggregated with the class. and Design

In this scheme, interfaces are specified to reveal as little Quality Design


Concepts
as possible about the inner workings of the object
Object Oriented
Cohesion Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Types of Cohesion (Desirable) Design

I Functional cohesion occurs when each part of a Software Design


Tools
component is necessary for the execution of a single Object Oriented
function (e.g., read transaction record) Programming
Concepts
I Object cohesion occurs when the functions of a Basics of Object
Oriented Analysis
common class of objects are aggregated with the class. and Design

In this scheme, interfaces are specified to reveal as little Quality Design


Concepts
as possible about the inner workings of the object
Object Oriented
Coupling Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I Coupling is a qualitative indication of the degree to
Software Design
which a module is connected to other modules and to Tools

the outside world Object Oriented


Programming
I In other words, coupling is a measure of interconnection Concepts

Basics of Object
among modules in a software structure Oriented Analysis
and Design
I Loose coupling is better as simple connectivity is easier
Quality Design
to understand and less prone to ripple effect Concepts
Object Oriented
Coupling Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction

Types of Software
Design
I Coupling is a qualitative indication of the degree to
Software Design
which a module is connected to other modules and to Tools

the outside world Object Oriented


Programming
I In other words, coupling is a measure of interconnection Concepts

Basics of Object
among modules in a software structure Oriented Analysis
and Design
I Loose coupling is better as simple connectivity is easier
Quality Design
to understand and less prone to ripple effect Concepts
Object Oriented
Cohesion Analysis and
Design

Types of Coupling Fundamentals of


(OO) Software
I Indirect coupling occurs when one object interacts Design

with another object through a third component, usually Introduction

a controller Types of Software


Design
I Data coupling occurs between two modules when data
Software Design
are passed by parameters using a simple argument list. Tools

When using data coupling, shorter parameter lists are Object Oriented
Programming
preferred to longer ones Concepts

I Stamp coupling occurs when a portion of data Basics of Object


Oriented Analysis
structure is passed among modules. When using stamp and Design

Quality Design
coupling, a smaller number of actual arguments are Concepts
preferable to a larger number because the only data
that should be passed to a module is what it requires
I Control coupling occurs when information is passed to
a module that affects its internal control. This is
undesirable because it requires the calling module to
know the internal operation of the module being called
Object Oriented
Cohesion Analysis and
Design

Types of Coupling Fundamentals of


(OO) Software
I Indirect coupling occurs when one object interacts Design

with another object through a third component, usually Introduction

a controller Types of Software


Design
I Data coupling occurs between two modules when data
Software Design
are passed by parameters using a simple argument list. Tools

When using data coupling, shorter parameter lists are Object Oriented
Programming
preferred to longer ones Concepts

I Stamp coupling occurs when a portion of data Basics of Object


Oriented Analysis
structure is passed among modules. When using stamp and Design

Quality Design
coupling, a smaller number of actual arguments are Concepts
preferable to a larger number because the only data
that should be passed to a module is what it requires
I Control coupling occurs when information is passed to
a module that affects its internal control. This is
undesirable because it requires the calling module to
know the internal operation of the module being called
Object Oriented
Cohesion Analysis and
Design

Types of Coupling Fundamentals of


(OO) Software
I Indirect coupling occurs when one object interacts Design

with another object through a third component, usually Introduction

a controller Types of Software


Design
I Data coupling occurs between two modules when data
Software Design
are passed by parameters using a simple argument list. Tools

When using data coupling, shorter parameter lists are Object Oriented
Programming
preferred to longer ones Concepts

I Stamp coupling occurs when a portion of data Basics of Object


Oriented Analysis
structure is passed among modules. When using stamp and Design

Quality Design
coupling, a smaller number of actual arguments are Concepts
preferable to a larger number because the only data
that should be passed to a module is what it requires
I Control coupling occurs when information is passed to
a module that affects its internal control. This is
undesirable because it requires the calling module to
know the internal operation of the module being called
Object Oriented
Cohesion Analysis and
Design

Types of Coupling Fundamentals of


(OO) Software
I Indirect coupling occurs when one object interacts Design

with another object through a third component, usually Introduction

a controller Types of Software


Design
I Data coupling occurs between two modules when data
Software Design
are passed by parameters using a simple argument list. Tools

When using data coupling, shorter parameter lists are Object Oriented
Programming
preferred to longer ones Concepts

I Stamp coupling occurs when a portion of data Basics of Object


Oriented Analysis
structure is passed among modules. When using stamp and Design

Quality Design
coupling, a smaller number of actual arguments are Concepts
preferable to a larger number because the only data
that should be passed to a module is what it requires
I Control coupling occurs when information is passed to
a module that affects its internal control. This is
undesirable because it requires the calling module to
know the internal operation of the module being called
Object Oriented
Coupling Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction
Types of Coupling Types of Software
Design
I External coupling occurs when a module depends on Software Design
the external environment Tools

Object Oriented
I Common coupling occurs when modules access Programming
Concepts
common areas of global or shared data. This form of
Basics of Object
coupling can cause one module to unintentionally Oriented Analysis
and Design
interfere with the operation of another module
Quality Design
I Content coupling occurs when one module uses Concepts

information contained in another module


Object Oriented
Coupling Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction
Types of Coupling Types of Software
Design
I External coupling occurs when a module depends on Software Design
the external environment Tools

Object Oriented
I Common coupling occurs when modules access Programming
Concepts
common areas of global or shared data. This form of
Basics of Object
coupling can cause one module to unintentionally Oriented Analysis
and Design
interfere with the operation of another module
Quality Design
I Content coupling occurs when one module uses Concepts

information contained in another module


Object Oriented
Coupling Analysis and
Design

Fundamentals of
(OO) Software
Design

Introduction
Types of Coupling Types of Software
Design
I External coupling occurs when a module depends on Software Design
the external environment Tools

Object Oriented
I Common coupling occurs when modules access Programming
Concepts
common areas of global or shared data. This form of
Basics of Object
coupling can cause one module to unintentionally Oriented Analysis
and Design
interfere with the operation of another module
Quality Design
I Content coupling occurs when one module uses Concepts

information contained in another module

You might also like