Friday, April 25, 2008

Object Oriented Programming vs Non Object Programming

Often people are confused about real benefits which are provided by OOP. I am trying to remove their confusion in this episode of blog. Every innovation in this world is related to solution of a problem. There is a problem, then we try to find out solution of that problem. So we have to work in two spaces. one is Problem-space in which we concentrate on problem only. and second one is Solution-space in which we develop solution. When we develop solution through computer, we have to think in terms of machine which happened in assembly language. It is impossible for one to get a sense of problem while reading an assembly program. So there is a big gap between problem and solution. People have to develop different artifacts to bridge this gap. After assembly, some other languages came like C, prolog and others , which provided some abstraction on machine but still there was a big gap e.g. prolog concentrates on reasoning and facts. After that OOP made its position, which really reduced the gap between problem-space and solution-space. What we understand and see in problem, we can easily map to a solution which provides us good sense of problem. I explain it with an example e.g. we are developing a solution for a library. Now everyone knows that library has some books and students draw books from library for some time and then return to library. Now if we think on problem, we will come to know that everything in library is relating to three entities Book, Students, and Library itself. Now when we develop solution of this in OOP, we will map these entities to classes and by taking a general look on it, one can easily understand what's going on in the solution and to what things this solution is related.
In short it is the OOP which reduced the gap between problem-space and soluton-space.


No comments: