Jose Sandoval Google
 Resume     Book     Software     Drawings     Home     Subscribe to RSS feed Search Web Search josesandoval.com

911, is a polymorphic number
Thursday, November 22, 2007

Going back to fundamentals is always a good thing. With OO design and development, it means going back to thinking about what inheritance, encapsulation, and polymorphism mean.

One of the things needed to accomplish OO in actual code is method overloading and overriding. The concepts are simple: with overloading, you can have multiple methods with the same name, as long as you change the signature of it (e.g., take on different input data); with overriding, you can change the functionality of a method if you are not satisfied with the inherited implementation. The point is that one method can be used to do different things depending in the context, or its inherited behavior can be modified depending on the need.

It's seems to be such a natural way of doing things. So it's not surprising the two concepts are part of modern programming languages. In the real world, however, overloading comes by easier than overriding. For example, any verb is overloaded. Take the verb run. Not all running is the same, and hence the input for the verb run becomes the context, i.e., Me.run(context). With this example, context can be "save life" or "enjoy scenery." The output is similar (running), yet the intention is completely different.

With overriding, think of things that are passed down to you--perhaps in the form of knowledge. Most of these things can be improved. For example, my parents taught me how to walk in the most basic sense. I, however, improved on the technique and overrode the basic premise of putting one feet in front of each other to generate motion. I became an expert on walking (by not falling so often), and also running--which, by the way, I learned to overload depending on the context. (There is a caveat with this example, as we already come wired with the notion that our two feet are for standing up, and our skeletal structure is made for walking, and that's what we do.)

There are many things we can't override. They are given in the form of inheritance. For example, the colour of my eyes was set the instant I was conceived. However, I can override their function with surgery or by putting eyeglasses in front them to play the with light before it hits my retina.

If you want to take this concept of human function overriding further, it can be done: we will be able to change a lot about us. Nonsense, you say. Well, experts are saying that we are within 50 years of enhancing our basic human functions (and I say basic, because I can't jump 4 meters high, or see through concrete; but there is nothing basic about us). This ability to change our nature is what people are calling the "singularity." In a few words, it means that at some point we will be part machine, part human. We will be able to enhance ourselves by implanting chips here and there, swallowing nano-robots to realign DNA malformations, and, essentially, cure everything that is incurable now--to the point of really living forever (avoiding natural death will be easy, keeping us safe from things we make that can kill us is another story). This is not so far fetch, as aging is the breakdown of cells and the inability to repair themselves. Therefore, if we are able to repair them at the molecular level, aging will be what the Apple Newton was to our generation: a good concept, but not good enough for the market. Finality has its advantages; however, given the alternative I'm certain most of us would indulge in some AI memory enhancement chips and nano-robot-drinks to fool old nature.

Going back to overloading and overriding. These concepts are found everywhere. Almost everything works this way. Don't take me wrong, I'm not the kind of guy that thinks I am a hammer and therefore everything looks to me like nail. No way, Jose. But for some reason, I started thinking about the 9-1-1 emergency system.

Two things came out of this. First, the emergency system, or 9-1-1 in North America (US and Canada), is one of those systems that have these two concepts as the root of their design. I doubt it was called a polymorphic system when it was originally put in place. However, every city must handle the call independently. I mean that it must know where it is to answer accordingly. What we don't want is anyone calling from Tampa Bay, Florida to reach Stratford, Ontario with an alligator emergency--there are no alligators in Stratford, and it's really far way from Florida.

So how does the system know to route the call to the proper city? If you think of the cities to be the context of the call, then it makes sense since a dial tone is a dial tone everywhere (again in North America) and everything gets connected without problems. For example, I have a unique phone number in the US and Canada, which is based on the area I live, i.e., the area code. So 9-1-1 is a funny number: it works the same regardless of where I am. Therefore, I think of 9-1-1 as a polymorphic, designed oddity of our phone system.

The second thing that came to mind is that if 2,000 years from now historians will look back at our 9-1-1 system and think that our society designed the system because of September 11, 2001? You may think this is preposterous, but the time span between the invention of the system and the World Trade Center being leveled to the ground is only 40 years. This is not long in written history, and, to date, there are many events that we can't really pint point with 100% degree of accuracy--we kind of say, "give or take 50 years." Of course, presently, we have public records of both events (and the internet to find the information in seconds), but if they get lost somehow, only the myth of both events will live. And someone will wonder if these events are connected somehow. I would, and history is subjective at its best, and subjunctive at its worst (though, I'm not sure if there's a difference).


10:55 AM | 0 comment(s) |

Comments:


This page is powered by Blogger. Isn't yours?

Guestbook
© Jose Sandoval 2004-2009 jose@josesandoval.com