SOFTWARE EVOLUTION
Machine language
Assembly language
Procedure Programming
Object Oriented Programming (OOP)
Evolution of OOP concept
Structure programming supported by C was
found inadequate in handling large, complex
real life system.
It was realised that “As complexity increases,
architecture dominates the basic material.”
Sequence of programming statements are
inadequate for computer programming.
Important requirements
Sound construction techniques
Reusability
Maintainability
Openness and interoperability
Security
Procedure Oriented
Programming Characteristics
Emphasis is on doing things (algorithms).
Large programs are divided into smaller
programs known as functions.
Most of the functions share global data.
Data move openly around the system from
function to function.
Functions transforms data from one form to
another.
Employs top-down approach in program
design.
Object –Oriented
Programming Paradigm
Emphasis is on data.
Problem decomposed into objects.
Object annotated with data &
functions.
Object data accessible only to its
function.
Objects communicate between each
other through functions.
Organization of data and functions in OOP
Object A Object B
Data
Object A Data
Functions Functions
Object C
Functions
Data
Characteristics of OOP
Emphasis is on data rather than procedure
Programs are divided into what are known as objects
Data structures are designed such that they characterize the
objects
Functions that operate on the data of an object are tied
together in the data structure.
Data is hidden and cannot be accessed by external functions
Objects may communicate with each other through
functions
New data and functions can be easily added whenever
necessary
Follows bottom-up approach in program design
Definition of OOP
Object oriented programming is an approach that
provides a way of modularizing programs by
creating partitioned memory area for both data and
functions that can be used as templates for
creating copies of such modules on demand.
Basic Concepts of OOP
Objects
Classes
Data abstraction
Data encapsulation
Inheritance
Polymorphism
Dynamic binding
Message passing
Objects representation
Object : Student
DATA
Name
Date-of-birth
Marks
………
FUNCTIONS
Total
Average
Display
……….
Classes
A class is an user defined data type
A class is a collection of objects of
similar type
Example : Class fruit
Objects : Fruit mango, apple etc
Class includes data and the functions
that manipulate the data.
Data Abstraction and
Encapsulation
Encapsulation. The wrapping up of data and
functions into a single unit(called class) is known
as encapsulation.
Data hiding : Insulation of data from direct
access by any subject function is referred to as
data hiding.
Abstraction : Act of representing essential
attributes of an object the size, weight and cost
etc.
Note : Classes are known as Abstract Data
Types (ADT)
Inheritance
Inheritance is the process by which objects of one class acquire the properties of
objects of another class.
Bird
Attributes
Feathers
Lay eggs
Flying Bird Nonflying Bird
Attributes Attributes
----------- -----------
----------- -----------
Robin Swallow Penguin Kiwi
Attributes Attributes Attributes Attributes
----------- ----------- ----------- -----------
----------- ----------- ----------- -----------
Polymorphism
Polymorphism is the ability to take more than one form.
Dynamic Binding refers to the linking the object with the code
(algorithm) at run time.
Shape
Draw ( )
Circle Object Triangle object
Box object
Draw (box) Draw (Triangle)
Draw ( circle)
Benefits of OOP
Through inheritance, we can eliminate redundant code and
extend the use of existing classes.
We can build programs from the standard working modules
that communicate with one another, rather than having to
start writing the code from scratch. This leads to saving of
development time and higher productivity.
The principle of data hiding helps the programmer to build
secure programs that cannot be invaded by code in other parts
of the program.
It is possible to have multiple instances of an object to co-
exist without any interference.
Benefits of OOP (cont’d)
It is possible to map objects in the problem domain to those objects in
the program.
It is easy to partition the work in a project based on objects.
The data-centered design approach enables us to capture more details
of a model in implementable form.
Object-oriented systems can be easily upgraded from small to large
systems.
Message passing techniques for communication between objects
makes the interface descriptions with external systems much simpler.
Software complexity can be easily managed.
Application of OOP
Real-time systems
Simulation and modelling
Object-oriented databases
Hypertext, hypermedia and expertext
AI and expert systems
Neural networks and parallel programming
Decision support and office automation
systems
CIM/CAM/CAD systems