runtime Polymorphism ?????

  • Thread starter Thread starter LP
  • Start date Start date
L

LP

Hi, I understand the concept/definition of polymorphism. But what does the
term "runtime polymorphism" mean? I was asked to define it during a
technical interview. I gave a guy vanilla definition of polymorphism, but he
insisted on runtime. Did I miss a new buzzword while I was sick with the flu
last week or something like that?
 
A quick google on it turns up a whold bunch of articles on "vanilla"
polymorphism, with no apparrent differences. Looks like just an alternative
wording.
 
Probably means virtual functions but it can also be a plugin. It is also
possible that this guy got it completely wrong.

Many definitions of plain vanilla definition of polymorphism are not
polymorphism at all in the strict sense of object oriented programmation;
however - and whatever the correctness of the answer - an interview based
on definitions usually mean that the guy doesn't really knows his stuff. A
technical interviewer should be able to ask technical questions; the kind of
questions whose answers will not be opened to various interpretations.

S. L.
 
Hi,

I believe that when one taks of runtime polymorphism, it really means of the
virtual functions and dynamic binding stuff.

Dynamic binding happens at runtime where in the objects are bound to type at
runtime depending on available business logic. Again Virtual Functions are
implemented and called on runtime based on user requests.

So can we term the above "Runtime Polimorphism"? Please suggest if I am
worng anywhere...

Ganesh
 
Hi, I understand the concept/definition of polymorphism. But
what does the term "runtime polymorphism" mean? I was asked to
define it during a technical interview. I gave a guy vanilla
definition of polymorphism, but he insisted on runtime. Did I
miss a new buzzword while I was sick with the flu last week or
something like that?

LP,

Like most computer science definitions, "polymorphism" is pretty well
defined when used in academic settings, but completely twisted
and abused when used in a commercial context.

A good academic definition can be found here:

http://en.wikipedia.org/wiki/Polymorphism_(computer_science)

C#'s inheritance mechanism is implemented by the compiler using
runtime polymorphism (i.e. virtual methods, dynamic runtime lookup
tables, late binding, etc...)

However, there are some people on the net who use the term "compile
time polymorphism" to refer to C#'s method overloading, like this
guy:

http://www.dickbaldwin.com/csharp/Cs000112.htm

(I personally have never heard the word "polymorphism" used to
describe method overloading.)

Other languages, like C++ and Ada, have a different kind of "compile
time polymorphism". In this case, a compiler can perform early
binding at compile time on at least some of the virtual methods that
are called in the code. Those virtual methods can then be called as
fast as non-virtual methods since there is no runtime lookup to
perform.

Google on the phrases "runtime polymorphism" and "compile time
polymorphism" to get more info.
 
Back
Top