Hey friends please do not take this article seriously. Its just that, I was sitting idle, thinking about the current situation in our country. Being a Techie, Its quite natural for me to relate the various real life aspects of this political environment to Classes and entities in our Object oriented world.
I have tried to capture a part of my silly thought into our exciting world of Classes and Objects. The programming language used for this article is C# and the development environment is Visual Studio 2008.
Well then…… Lets get started…
Since Anna Hazare, has been the most talked about person these days, here is a class dedicated to “Anna”
The class name is “AnnaHazare“.
It inherits from MahatmaGandhi and implements two interfaces namely ILokmanyaTilak and IMahatmaPhule.
It indicates that our Anna has adopted the ideology of fasting from Mahatma Gandhi, his ability to garner nationwide support from Lokmanya Tilak where as his struggle to bring about social development has came from Mahatma Phule. The Methods “StartFast” and “NationWideProtest” take in one parameter which is “ReasonForProtest” emphasizing the reason for which Anna is protesting. The third method “SocialDevelopment” has no specific reason. The return type of all these methods/functions is “BetterIndia”. Details of class BetterIndia could be found below.
The above class is for Harvinder Singh. The guy who slapped Sharad Pawar and Sukhram. Well this person has no political or social stature when compared to Anna. He stands no where when compared to great people like Bhagat Singh, Rajguru and other revolutionaries. But today he represents the young generation of India, who do not get proper opportunity to prosper. Who are frustrated watching our political leaders in-activeness and are annoyed by daily news of huge sums being siphoned out of public coffers. He is just another common man whom we might forget in few days. But he sure was the hero of that moment. He did sent out a strong message to our political class that our patience is running out. In public we might not accept it, but the news did give many of us a reason to cheer.
The first method in this class “SlapPolitician” is for his slapping act. It takes the politicians name as an input parameter. This method is overridden from Bhagat Singh. Well, I know that Bhagat Singh has never performed such act. But as most of us might be aware, Bhagat Singh threw a crude bomb in parliament. His intention was never to kill anybody. His aim was to send out a strong message to the british about our ability. Similarly Harvinder Singh had his knife with him during his slapping act. He could have used it easily, but that was not his intention.
The other method is “AbusePolitician” for his post slapping commentary. Even this method takes in a politician as a parameter. The return type for both these methods is “HappyIndia”
Well the above screen shot depicts our great leaders with one of there prime functional behavior taking form of a method.
I know, I am a bit unfair when it comes to the above class. I am sure not all our leaders are corrupt and goons. Few of them, like our current PM, Dr.Manmohan Singh and Pranab mukherjee are arguable the most safest hands to run a diverse country like ours. That too at a time when developed nations around the world are having a tough time to keep there house in order. So the above depiction is definitely not for them, its a kind of perception which has been created about these people because of few rotten eggs. Off course, no one has the courage to throw these rotten eggs out of the basket.:(
The class has properties like NameOfPolitician, IsCorrupt, IsInJail, NumberOfCriminalCases & SizeOfScams etc. which are quite self explanatory. The constructor takes in one parameter of politician, based on which it initializes the “PoliticalLeader” object. The constructor uses various methods like “CheckIfCorrupt”, “GetSizeOfScams”, “GetNumberOfCriminalCases” etc, from the Interfaces implemented, to initialize the object.
The above screenshot has classes like HappyIndia and BetterIndia which describes the mood and the state of the nation respectively. The classes represent the outcomes of the various protests and agitations. The two interfaces, ICorrupt and ICriminal are implemented in PoliticalLeader class. The Methods in these interfaces are implemented to find various related properties like if the politician is Corrupt, The size of his scams, whether he/she is currently in jail etc.
Two enums are used in this example, the first one is ReasonForProtest – It represents the reason for which protest was carried out like Lokpal, RightToReject etc. The second one is a small collection of politicians who are either controversial or are usually in the news for wrong reasons.
An object is created for both AnnaHazare and HarvinderSingh. Based on their protesting style, two methods namely “PeacefullProtest” and “ViolentProtest” are being incorporated. Anna’s protest like his recent fast for Lokpal bill and the proposed nation wide agitation for Right to Reject form the functionality of the first method i.e. “PeacefullProtest”. Where as Harvinder Singhs slapping act to sukhram and Pawar followed by his free flowing abuses for politicians form the functionality of the other method i.e. “ViolentProtest”.
So friends, this is a small attempt by me to put my thoughts in the form of words, by using a popular programming language. Like I have already said, this article is created just for the sake of humor. I enjoyed the thought and the efforts needed to put it into this blog. Hope you like it too. And if at all you do, please let me know your feedback.