Chapter# 3 - Feature of OOP
Chapter# 3 - Feature of OOP
These languages are based on the top down methodology in which a system
is further divided into compositional subsystem.
Computer programs in these languages are design with the aid of loops,
sequences and decisions.
Structured programming is not only limited to the top down approach. It
employs methods using:-
1. Top down analysis for problem solving: It focuses on dividing the problem
into sub parts and hence simplifies the problem solving.
2. Modularization for program structure and organization: It organizes large
instructions by breaking them into separate and smaller section of modules,
sub routines and subprograms.
Structured Programming languages
3. Structured code for the individual modules: Control structures are used to
determine the exact order in which the set of instructions are to be executed.
Therefore, a structured code does not involve GOTO statement as it
represents no certain order of execution.
Example ALGOL, Pascal, Pl/I, C , Ada
Object Oriented Languages
Object oriented programming (OOP) is a programming model where
programs are organized around object and data rather than action and logic.
OOP allows decomposition of a problem into a number of entities called
Object and then builds data and function around these objects.
The program is divided into a number of small units called Object. The data
and function are build around these objects.
The data of the objects can be accessed only by the functions associated
with that object.
The functions of one object can access the functions of other object
The mechanism of binding the code and the data it manipulates and keeping
both safe from outside interference is called as encapsulation.
In other words , the wrapping up of data and its functions into a single unit is
called Encapsulation.
Abstraction
Abstraction refers to the act of representing essential features without
including the background details or explanation between them.
Abstraction is one of the key principles of the OOAD (Object oriented
analysis and Design).
For example , a mobile phone has various features like sms, calling, music
player, camera ,etc. You don't need to know how this things work internally ,
you directly use it. This is possible because of abstraction.
Inheritance
Inheritance is the concept by which the properties of one class are made
available to another.
It allows the new classes to be built from the older instead of being rewritten
from scratch.
The concept of inheritance provides the idea of reusability and extensibility.
Polymorphism
Polymorphism is a Greek term where poly means many and morph means
form.
It simply means 'one name multiple forms'.
The most common use of polymorphism in OOP occurs when a parent class
reference is used to refer to a child class object.
Message Passing
A message for an object is a request for execution of a procedure , and
therefore will invoke a function (procedure) in the receiving object that
generates the desired result.
Objects can send or receive message or information.