Friday, 3 April 2015

Object-Oriented Programming

Object-oriented programming is based on objects. Every value in Python is an object. Object can also be something else. For example, if I design a GDP calculating system then I need to have some objects such as 'CPI Intention' or 'Plan Aggregate Expenditures', etc. Objects can also be subclasses of my parent class. We use inheritance to extend a class. Subclasses do some specific task and parent class defines what all subclasses need to do. A subclass may also have its subclass. We are able to make a 'chain' if we need it for our purpose. Separating a huge class into many children would definitely make organization much clear.

No comments:

Post a Comment