Friday 7 March 2014

Object Oriented Programming

This is my first Blog.I like to start writing with basics and move ahead step by step. So I am starting with the very basic but most important concept which is "Object Oriented Programming".

After few interactions with my fresher colleagues and my self experience I think at fresher level we don't understand the exact use of Object Oriented Programming. We just read the list of features and some common examples of OOP to understand what is OOP. We even compare the object oriented programming language with procedural language but don't understand the use of OOP.
Here I am trying to write some thing which help us to understand why OOP ?
I have explained it with very simple examples.

Lets start with Object. What is Object ? You might have an idea about it, if not, here it is a brief about what is object.
So Object can be any living or non-living entity, which has some properties, which has some functionality. e.g. A Table, Student, Vehicle, Person, Bird, Database, Computer, your Home can be an Object. For these things we can define properties lets take an example of Student. What Properties you can define for Student ??

  1. The Name of Student
  2. The class of the Student
  3. The Roll Number of Student
  4. Marks obtained by Student
  5. The School / College name in which student is studying.
You can have many other properties for this object. I have taken example of Student because this article is actually written for freshers who just passed out or who is still doing study. So the term student is familiar for them.

As we have defined the properties of the Object (Student) similarly we can define functionality of Object. Take an example of Vehicle.
  1. Start the vehicle
  2. Stop the vehicle
  3. Change gear of vehicle
Obviously we have properties for this object as well. You might have guess till this time.
  1. Type of Vehicle
  2. Fuel capacity
  3. Mileage of vehicle
  4. Name of the vehicle
  5. Company name of vehicle
Till this point you might get board because of the regular text but here after you find text which is quite interesting.

Lets say we have to work with some of above entities. How will you do this without object ???
Lets say we have to work with Student data. How do you define the properties of student and how will you process the data related to Student ?

So if you have an object for Student then it is easy to hold all data in one object and it would be easier to do process on it. e.g. we can save the name, roll number, marks of student in a single object and we can create multiple objects for multiple students. So when you want to transfer the student data then you don't need to pass all properties separately you can just pass the object.  If you don't have object you need to pass all value separately. So it mean by using object data transfer is easier. but this is not all what we do with object. This is a very brief description about project just to get an idea about what is an object and why object if you have doubts or any questions please share your comments.



 
Click here for AOP Introduction :  Aspect Oriented Programming Introduction