Object Oriented Program (Paradigm)
Paradigm -
It is a mythology and implementation of the program.
(It is a way of programming)
Therefore, There are three ways (Style) to write a program -
♣ Procedural Programming
♣ Object Based Programming
♣ Object Oriented Programming
Procedural Programming -
☻ Importance is given to the procedural (Function and Methods)
☻ Data is secondary ( data moves openly)
☻ It follows Top-Down Designing.
Example - Basic and C
Object Based Programming -
☻ These languages support Classes
☻ These languages does not support Inheritance and Polymorphism
Example - ada
Object Oriented Programming -
☻ These language support all the mentioned features- Encapsulation
- Abstraction
- Polymorphism
- Inheritance
☻ Data is hidden
☻ It follows bottom up design
Example - C++ , Java etc.
Now,
Object Oriented Programming (OOP's) in detail
DEFINITION OF OOPs
" OBJECT ORIENTED PROGRAMMING refers to a programming methodology based on objects, instead of just functions and procedures. These objects are organized into classes, which allow individual objects to be group together. Most modern programming languages including C,C++, C#, JAVA ,PHP, etc are objectoriented languages. "
0r
" OBJECT ORIENTED PROGRAMMING as an approach that provide the way of modularizing program by creating partitioned memory for both Data and Function that can be used as a templates for creating copies of such a modules on demand. "
In
Short OBJECT ORIENTED PROGRAMMING
is described as under :-
◘ It's Abbreviation of
OOPs.
◘ OOPs Stands for OBJECT
ORIENTED PROGRAMMING System.
◘ It is a kind of Model or
Concept.
◘ It was invented to overcome the drawback of the POP(Procedure Oriented Programming).
◘ Used to define (wright)
programs.
methodology (way to developing a program) based on objects instead of just functions and procedures.
◘ In these types of
programming you have to make CLASS because without class you can't make
OBJECTs. OOPs is based on OBJECTS that is
generated from the CLASS.
◘ It has some important
features that we will be using during developing our code. Some are ○ Encapsulation
○ Abstraction
○ Polymorphism
○ Inheritance
Examples of it C ,C++
, C# , JAVA , PHP , SMALL TALK etc.
◘ Objects is created from
Classes. (also say that object is a instance of
the class)
Abstraction: The process of representing important features and hiding background details is known as Abstraction. It is also called Data Abstraction or Data Hiding. ***** Class: A class is a group of common object. It is user defined data type. It Contains variables and functions. The class defines all the common properties of the different objects that belong to them. ***** Object: It is the instance of a class. 0r Object: It is a Run time Entity having some specific characteristics and behaviour . It is a variable of class type. ***** Inheritance: It is a feature that represents the "IS A" relationship between different classes. 0r Inheritance: Deriving properties from one class into another class is know as Inheritance. ***** Encapsulation: Wrapping of a data and function in a single unit is called Encapsulation. ***** Information hiding: The process of hiding details of an object or function. Information hiding is a powerful programming technique because it reduces complexity. ***** Messaging: Message passing is a form of communication used in parallel programming and object-oriented programming.(basically objects are communicating with each other) ***** Polymorphism: "Poly means many and Morphism means form." Therefore Polymorphism is defined as the ability for a message or data to be processed in more then one form. It is also called overloading. It is of two types- 1- Function/Method overloading Using single function name to perform different type of tasks is known as Function Overloading . 2- Operator overloading For Example - Consider the Operation on addition For two numbers the operation will generate a sum 2 + 3 = 5 If the operands are string , then the operation gives third string by concatenation abc + xyz = abcxyz The process of making an operator to exhibit different behaviors in different instance is known as operator overloading. |
By - Somesh Sah
Comments
Post a Comment