Oops 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

ST.

THOMAS’ COLLEGE OF ENGINEERING AND TECHNOLOGY

OBJECT ORIENTED PROGRAMMING ( PCC – CS 503 )

BASICS OF OBJECT ORIENTATION

A. K. SIROMONI
STCET
Lecture on BASICS of OOP

At the End of the Lecture Students will be able to -


Lecture Objective 1 : Understand difference between Object
Oriented and Procedural approach

Lecture Objective 2 : Understand Software Life Cycle

Lecture Objective 3 : Design a solution in Object Oriented way

A.K.SIROMONI (AIML) 2
PRODUCT , PROJECT AND PROGRAM

• WHY WE NEED TO LEARN AND WORK WITH COMPUTER


IN SCHOOL , COLLEGE, OFFICE AND EVEN IN HOME ?

• WE HAVE TO SOLVE SOME PROBLEM . THE BIGGEST


PROBLEM IN SOLVING IS , THE PROBLEM IS ALWAYS
UNIQUE IN COMPUTER SCIENCE AND INFORMATION
TECHNOLOGY DOMAIN.

THE CREATER OF THE PRODUCT MAY BE SATISFIED WITH THE


QUALITY OF THE FINAL PRODUCT BUT IT IS ULTIMATELY USER’S
SATISFACTION AND ACCEPTANCE DETERMINE THE QUALITY OF THE
FINAL PRODUCT.

A. K. Siromoni ( STCET) 3
SOFTWARE ENGINEERING

SOLVING THE COMPLETE PROBLEM


STEPWISE AND PRODUCE A SOFTWARE
PRODUCT WHICH DEALS WITH THE
SOLUTION WITHOUT ANY ERROR,
EXCEPTION AND DEFECT IS SOFTWARE
ENGINEERING.

A. K. Siromoni ( STCET) 4
PRODUCT , PROJECT AND PROGRAM

REQUIREMENT : PRODUCT
P
PROBLEM SOLUTION
FEASIBILITY STUDY PRODUCT R
O
REQIREMENT ANALYSIS ACCEPTANCE TESTING
J
DESIGN SYSTEM TESTING
E
IMPLEMENTATION INTEGRATION TESTING C
(CODING) UNIT TESTING
T

A. K. Siromoni ( STCET) 5
OBJECT ORIENTATION VS PROCEDURAL APPROACH
• IN OBJECT ORIENTED APPRACH , THE MAIN AIM IS WHO ( THE OBJECT )
CAN SOLVE THE PROBLEM

• IN PROCEDURAL APPRACH , THE MAIN AIM IS HOW ( THE ALORITHM )


CAN THE PROBLEM BE SOLVED
EXAMPLE
Problem : SOME DATA HAS TO BE PRINTED IN ASCENDING ORDER
PROCEDURAL SOLUTION : EFFECTIVE AND EFFICIENT SORTING ALGORITHM
HAS TO BE CODED .
SORT( int *array ) ; // sort is a function to be implemented to arrange array

OBJECT ORIENTED SOLUTION : TO FIND AN OBJECT WHO KNOWS EFFECTIVE AND


EFFICIENT SORTING .
A.SORT(array) // A is an object who knows sorting

A. K. Siromoni ( STCET) 6
OBJECT ORIENTED ANALYSIS :
Object-oriented analysis is a method of analysis that examines
requirements from the perspective of the classes and objects found in the
vocabulary of the problem domain.

OBJECT ORIENTED DESIGN :


Object-oriented design is a method of design encompassing the process of
object-oriented decomposition and a notation for depicting both logical and
physical as well as static and dynamic models of the system under design.

OBJECT ORIENTED PROGRAMMING:


Object-oriented programming is a method of implementation in which
programs are organized as cooperative collections of objects, each of which
represents an instance of some class, and whose classes are all members of
a hierarchy of classes united via inheritance relationships.

REFERENCE : OBJECT ORIENTED ANALYSIS AND DESIGN WITH APPLICATIONS, SECOND EDITION,
ADDITION – WESLEY , BY GRADY BOOCH
A. K. Siromoni ( STCET) 7
ANALYSIS AND DESIGN:
DEFINITION OF SOME KEYWORDS

A PROBLEM IS DECOMPOSED INTO SMALLER PIECES TO REDUCE COMPLEXITY AND


FOR EASIER DEBUGGING.

SMALLEST / ATOMIC PART OF ALGORITMIC DECOMPOSITION : FUNCTION

SMALLEST / ATOMIC PART OF OBJECT ORIENTED DECOMPOSITION : CLASS

COLLECTION OF ROUTINES ( FUNCTIONS, CLASSES etc ) WITH SIMILARITY : MODULE

EXAMPLE OF MODULES : HEADER FILES (C / C++) , PACKAGE ( JAVA, PYTHON)

INTERDEPENDENCE AMONG MODULES : COUPLING ( SHOULD BE LOW )

INTRADEPENDENCE AMONG MODULES : COHESION ( SHOULD BE HIGH )

A. K. Siromoni ( STCET) 8
ANALYSIS AND DESIGN:
DEFINITION OF SOME KEYWORDS
Entity : A thing with distinct and independent existence.

Obect : An entity with state , behavior and identity , an instance of a


class.
Class : A class is a set of objects that share a common structure and a common
behavior.

State The state of an object encompasses all of the (usually static) properties of
the object plus the current (usually dynamic) values of each of these properties.
The state of an object represents the cumulative results of its behavior.

Concrete State : The state where behavior of an object / objects remain same
from start to end of a sequence of an event.
Concrete Class : A concrete class is a class that has an implementation for all of
its methods with no abstract methods.

Concrete Invariant : A set of properties remains same through out the state of
the object.

A. K. Siromoni ( STCET) 9
ANALYSIS AND DESIGN:
DEFINITION OF SOME KEYWORDS

Abstract State : The State which virtually exists but not exist actually for an
object in state change sequence .

Abstract Class : A class is where at least one functionality (method) is not


defined . So no object of that class can be directly accessible .

Abstract Function : A function whose declaration is available in class but


definition is not available . So an abstract function create a class to be an
abstract class.

Behavior : Behavior is how an object acts and reacts, in terms of its state
changes and message passing.

Identity : Identity is that property of an object which distinguishes it from all


other objects in a particular scenario.

A. K. Siromoni ( STCET) 10
ANALYSIS AND DESIGN:
DEFINITION OF SOME KEYWORDS

Data : Facts and numbers collected together for reference , examination or


analysis to help decision making.

Analysis : An investigation of the component parts of a whole problem and


their relations in understanding the whole solution.

Design : IEEE defines software design as ‘both a process of defining, the


architecture, components, interfaces, and other characteristics of a system or
component and the result of that process.’
*IEEE : Institute of Electrical and Electronics Engineers

Data Dictionary / Metadata : Data dictionary means all information about data
and relations used in the database.

Information: Relevant data processed together to generate knowledge about


the system and decision making.
A. K. Siromoni ( STCET) 11
OBJECT ORIENTATION VS PROCEDURAL APPROACH

EXAMPLE

Problem : A TOLL BOOTH OPENS AT 8AM AND CLOSES AT 8 PM . EVERY CAR CROSSES
THE TOLL BOOTH HAS TO PAY ₹ 1.00 . IF ANY CAR DOES NOT PAY, THE CAR NUMBER
IS NOTED. CREATE A SOFTWARE PRODUCT TO GENERATE REPORTS FOR

1) TOTAL MONEY COLLECTED


2) CAR NUMBERS WHICH HAVE NOT GIVEN MONEY

WHAT WILL BE THE DIFFERENCE BETWEEN OBJECT ORIENTED


APPROACH AND PROCEDURAL APPROACH ?

A. K. Siromoni ( STCET) 12

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy