Fork me on GitHub

Tuesday, August 27, 2013

Just objects...:D



            Before I learn't of object oriented programming, everything was just what it was. A fridge was a fridge, a car was just a car and so was everything else. After learning object oriented principles, my mind has totally been corrupted .A  car is now a baby of a vehicle and it too can have babies (Jeep, Suzuki you name them) by virtue of inheritance.  A car has other ‘objects’ like engine that perform various actions (methods).  These methods are abstract (hidden) and only defined in the mechanic package. I don’t know if it’s a good thing but everything now is just an object.
            Here is what OOP has done to me. People have become objects, Secrets have become private instance variables, conversations have become public accessor methods, character has become a protected instance variable; if not inherited from parents (super class) is set by mutator methods or constructors. It has become a perfect model of social dynamics, making programming appear very natural.
            OOP makes it seem that nothing is a mystery. As long as it can be organized, and stored in some sort of database, it is not a mystery. It is in fact just an object , an instance of a class, having predefined properties.  It makes organization easy. An ancient Roman Emperor Marcus Aurelius, once said “The secret of all victory lies in the organization of the non-obvious.” The secret probably lies in object oriented programming.
            Coming from Python, object oriented programming seemed very unnecessary. I always questioned myself whether it was necessary to encapsulate an object just to be able to perform an action on it. Well, in the real world everyone is an object and needs to be identified as belonging to a class before doing anything. Everything, absolutely everything on earth, is an object having members and methods. Like objects, we have an hierarchy that needs to be acknowledged so that everything flows naturally.
            There is no turning back from OOP. Everything belongs to a class, even if the class is a Mystery class  If you have done OOP, you have a powerful tool in your hands; use it, if you haven’t I say you are missing out.  It is an interesting concept, so in the meantime, let’s talk about ‘objects’ over “Java”. 

1 comment:

  1. Java -write once,run anywhere.One of the most leading language in the world

    ReplyDelete