The Dream OF OOP
The oop has emerge above the procedural programming like an expected twister after the long heavy air flow.The magic in oop is enormous.Once u got the understanding
it will become the part of your life to find the real problem (what ever the life under cosideration in given context of problem) and costruct the objects and solve the problem till it exist.There are number of tutorial one can get there is nothing special about this.so why i am wasting my time for typing this html?
This tutorial deals with the higher part of the oop for the basic one needs to get some good tutorial.
Suppose the task is to simulate the global warming.Most of us have seen this in movies.So let's start.Make the plan
Plan for the ooP design,means what exactly we are going to do.Say we are damm serious about this and want the whole impact
on the earth.so earth is at the center of our thinking.We don't want to make this simulation complicated by incorporating
what will happen on mars when every body will froze on the earth.So our space is ristricted to the earth only.This is what the boundry conditions one need to decide for any kind of design.
Build Your Plan
So now build what u have placed so far on the piece of paper.So quiry your object for the things u need to see associated with it,and put it together as a initial set up of the object.Like how many country are their on earth add the country.what does each country has like how much water where the water is and how the water flowing for where to where.Which part has which property like plane ground landscape or ice caps etc.
SO it's a time to impliment the things in your programm.It's easy to talk and walk than coding for the underline things
here it goes
- object earth:
- india child of earth:
USA child of earth:
now one can undertand there is a similar design for each country.So if one want to see what will be the effect of the rise in temperature on the water of the earth one just has to say earth's country.riseTemparuture(50^c) and we can find the inpact on the water in each country.yes.....yes....let me tell u what is earth's country
earth's country is the abstract class for each country on the earth.This is evolution.
After the first design we come to understand that there is need of some thing that we can call for each country having the position gravity set for that country.And we will get the result for all the nodes(that is country).Now let's turn the discussion more towards practical.
each colorful node represents the country on the earth has all the variable set for the initial temparature in the country the number of rivers area near sea cost etc.now if temparature increses then we need to say temprature rise for each country and calculating the the direction of the flood.Instead of doing this we can just decide the rule how the water will
flow but cheer guys newtone already has done this that is gravity and we this force is associated with the water in the country as a country of the earth.then we say each country is member of earth and so tne name earth'sCountry will be the best name for it.
Things will again become simplar for us as we just has to say temprature rise on earth so the are like antartica will melt
water will flow as antarica will talk with it's nearest object england and then with other and so on flood will come in
country by the method earth'sCountry.flood() if the country has the capability to bring the flood it will come or argument will pass on to the next.
For complete simulation just say as fallows.........
- Belive me friend we have done the things which can make at least 15 minutes of any commercial movies of hollywood,OR a project of global warming which will be helpfull for the scientist
In this way the complex programm like this is converted to just few line child play but the core design will take the at most of your energy and the time.If you become the part of the game i.e. ooP u will never come out of it.Though your
mom telling u wake up you bastard.And i have to wake up.This is the dream last night i saw ......
if u want to learn seriously some ooP concept mail me i will send u few books and receipe how to become the don of the programming.