Object Oriented Programming
Why do we need Object Oriented Programming. To answer this question we first need to find out the drawbacks that was faced in Procedure Oriented Programming Languages ( C, FORTRAN, COBOL) .
Procedure Oriented Programming Languages consist of a list of instructions organised into groups called functions. Functions are executed sequentially as per the instructions but little attention is paid to the globally declared data which is accessed by mutliple functions at a time in a multi-functional program. If we need to change a particular value of a variable we have to make changes to all the functions hence the data becomes vulnerable to change in case of multi-functional programs.
Some of the features of Procedure Oriented Programming are:-
- Large programs are divided into smaller programs known as functions.
- Most of the functions share common global data.
- Data moves freely around the system from function to function.
- Functions transform data from one form to another.
- Employs top-down approach in program design.
Object Oriented Programming(OOP)
One of the most salient feature of OOP is that it treats data as a critical element in the program development and does not allow it to move freely around the system. It ties the data more closely to the functions that operate on it, and protects it from accidental modifications from outside functions. OOP allows the decomposition of a problem into a number of entities called objects which comprise of data and functions exclusively.The data of one object can be accessed only by the functions associated with that object. However functions of one object can access the functions of other objects.
Example of Object Oriented Programming Languages are :- C++ , Java , etc.
Features of Object Oriented Programming
- Emphasis is on data rather than the procedure.
- Programs are divided into objects.
- Functions that operate on the data of an object are tied together un 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 added easily whenever necessary.
- Follows bottom-up approach.
Definition of OOP
Object Oriented Programming is an approach that provides a way for modularized 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.
Thus, an object is considered to a partitioned area of computer memory that stores data and set of operations that can access the data. Since the memory partitions are independant, the objects can be used in a variety of different programs without modifications.
Basic Concepts of Object-Oriented Programming
The concepts which will be used extensively in OOP are :-
- Objects
- Classes
- Data abstraction and excapsulation
- Inheritance
- Polymorphism
- Dynamic binding
- Message passing
I hope you liked this and I am sure you can let me know of your requirements through comments.
Thank you :)
No comments:
Post a Comment
Thank you for commenting.