Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

What are principles of object oriented programming?

Earlier we had 2 major programming paradigms namely procedural programming paradigm and modular programming paradigms. Both of these paradigms could not model the real world very well and gave the data a second class status. The programming was actually focused up on the procedure of solving a particular problem rather focusing on the problem itself.
All these issues led to the failure of those two paradigms and a new programming paradigm was born with absolutely new principles and new idea. This paradigm is now popularly known as the object oriented programming paradigm.

About Object Oriented Programming

– This paradigm unlike the other two gives the data a first class status i.e., everything else revolves around the data.
– Here the data along with its member functions is grouped or encapsulated in to a single run time entity called the object.
– Thus, the object oriented programming models any problem in terms of the objects.
– In a program communication between objects is very important for execution and here this is established with the help of the member functions of the objects.
This programming paradigm is complete with many object oriented exclusive features such as the following:
1. Abstraction
2. Encapsulation
3. Polymorphism
4. Modularity
5. Inheritance
6. Reusability
7. Dynamic binding etc.

Today almost all of the modern programming languages have built in support for the object oriented programming. Like every other programming paradigm this one has also got some principles which we are going to discuss.
The above mentioned features in the article are nothing but the principles of this paradigm. Let us see them in detail:

1. Data Abstraction
– This is the most fundamental principle of OOP which also helps in incorporating the idea of data hiding.
– Example: You want to switch on the fan. So you just turn it on by pressing the switch. You don’t need to know about how actually the fan is running or how it actually got switched on. All you know is you need to press the switch whenever you want to switch on or off the fan.
– In other words, the back ground or the implementation details are hidden from you.
– This concept when applied in programming is called data abstraction.
– This principle is all about the development of the objects in terms of functionality and interface rather than in the terms of the implementation details.

2. Encapsulation
– This principle of OOP is closely related to the first principle i.e., abstraction.
– The data abstraction principle alone is not enough for implementing data hiding.
– This principle guarantees the safety of the data by enveloping or binding it within a single unit along with its member functions.
– It is possible while the program is in execution for the data to be accessed or modified by unauthorized users.
– This principle protects the data from such accidental access or modification.

3. Inheritance
– In most of the cases, it happens that it may be require containing many objects within an object which might again be contained in some other object.
– In such cases, the sub objects need to have the same properties and characteristics as that of the parent object or the object which contains them to maintain the balance of similarity.
How this is to be achieved?
– To achieve this, the object oriented paradigm provides us with the principle of inheritance.
– This principle provides an object several ways to relate to some other object such as “has a”, “uses a” or “is a” and so on relationships.
– Using this principle may objects can be derived from one parent object.

4. Polymorphism
– This is such a critical principle that if it is not supported by a language, that language cannot be counted as an object oriented language.
– Polymorphism has its origin in Greek language and means ‘one name, many forms’.
– This principle has enabled many of the languages to use the same operators and functions for carrying multiple tasks.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>