Monday, November 17, 2008

OOPs................I am confused

History repeats itself. My lazy friend Manu (or AP as I fondly called him) who onced missed his IT class and clarified from me about system architecture, asked me one day over the cofee table about OOPs. Follwoing is the discussion we had

AP : Hey Hardik my IT teacher has asked me to read about OOPs and come in his next class. I am a little confused, is he talking about the OOPS movie made by Deepak Tijori or something related to IT because I have never heard about it before.

Me : Come on AP, dont be so silly, OOPs according to your IT teacher means object oriented programming.

AP : Oh! whats that?

Me :Its a type of programming in which programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects can inherit characteristics from other objects.

One of the principal advantages of object-oriented programming techniques over procedural programming techniques is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer can simply create a new object that inherits many of its features from existing objects. This makes object-oriented programs easier to modify.


And yes you need to know object oriented language to perform OOPs. some of the comon languages are Java, C++, etc

Manu : Ok but it sounds simmilar to data modeling.

Me: Yeah it does but they are actually not. Data modelling have entities which contains attributes where as OOPs has classes which are colection of objects, and classes contains attributes.

Manu : Fine is that all i need to understand

Me : You need to understand another term method which makes OOPs diffeent from all other concepts of data modelling. Method is a process that makes changes to the attributes of an object, or instance, of a class For example the class MANAGER could have a method called promote that will change the value of the attribute called designation in an object of the class called EMPLOYEE.

Further The OOPs process would consist of creating a hierarchy of classes – each with its own attributes and methods. In some cases the classes would have to be built from scratch – which means that the attributes and methods will have to be defined in terms of a specific programming language like Java. But in the vast majority of cases, the classes will be built on a foundation of pre-existing classes that are provided through a framework that comes along with the Integrated Development Environment

Manu : Thanks a lot Hardik

No comments: