473,856 Members | 1,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

runtime Polymorphism ?????

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?
Nov 16 '05 #1
4 7399
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.

"LP" <lp@a.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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?

Nov 16 '05 #2
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.

"LP" <lp@a.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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?

Nov 16 '05 #3
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

"LP" wrote:
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?

Nov 16 '05 #4
"LP" <lp@a.com> wrote in
news:#B******** ******@TK2MSFTN GP09.phx.gbl:
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, "polymorphi sm" 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/Polymor...ter_science%29

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 "polymorphi sm" 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.

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
2868
by: Mike Meng | last post by:
hi all, I'm a newbie Python programmer with a C++ brain inside. I have a lightweight framework in which I design a base class and expect user to extend. In other part of the framework, I heavily use the instance of this base class (or its children class). How can I ensure the instance IS-A base class instance, since Python is a fully dynamic typing language? I searched and found several different ways to do this:
18
12608
by: Ken | last post by:
Hi. Can anyone refer me to any articles about the compatibility between c++ polymorphism and real-time programming? I'm currently on a real-time c++ project, and we're having a discussion about whether we should allow polymorphism. Our system is not embedded and does not need to be as real-time as, say, a pacemaker. But it does involve updating displays based on radar input. So a need for something close to real-time is desired...
4
2291
by: AdamM | last post by:
How can I change an object's type at runtime? For example, here's what I want to do in psedocode: object animal; if (dog) { animal=(dog)animal;
4
4952
by: arunvnk | last post by:
It is not quite clear why the compiler uses rntime polymorphism when the virtual keyword is specified. Since the virtual Keyword is specified,why can't the compiler decide at the runtime itself,which function is to be called,even if the function is called by the base class pointer??
2
2032
by: eric.dennison | last post by:
In the sample below: testClass is derived from object. We can cast object to testClass, no problem We can cast testClass to object no problem Compiler is ok with cast object to testClass but fails at runtime. Why?
7
4332
by: doina | last post by:
Hello, Can I have runtime polymorphism using references. I knew that runtime polymorphism could be obtained only by pointers, but now I have tried this in Visual C++ 8.0: #include <iostream> using namespace std;
11
2989
by: chsalvia | last post by:
I've been programming in C++ for a little over 2 years, and I still find myself wondering when I should use polymorphism. Some people claim that polymorphism is such an integral part of C++, that anybody who doesn't use it might as well just program in plain C. I totally disagree with this, because I think C++ has a lot of great features apart from polymorphism, such as the ability to organize code into classes, code reuse through...
16
5436
by: desktop | last post by:
I have read that using templates makes types know at compile time and using inheritance the types are first decided at runtime. The use of pointers and casts also indicates that the types will first be know at runtime. But is there some strict definitions that defines runtime code and compile time code that can be used in general?
8
6794
by: Ralf Goertz | last post by:
Hi, I want to do able to declare an object bar of a templated class foo where the actual template type of foo is only know at runtime: ----- #include <string> template <class Tclass foo {
0
9764
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11063
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10699
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10790
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9535
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7932
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5762
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5960
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.