Re: What about real polymorphism ?? [message #41954 is a reply to message #41953] |
Fri, 10 December 2004 08:23   |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Fri, 2004-12-10 at 12:00 +1300, Mark Hadfield wrote:
> David Fanning wrote:
>> Michael Wallace writes:
>>
>>
>>> Quite a thread you guys have here. Anyway, I can't speak for objects in
>>> IDL since I haven't actually learned how to use them yet, although I
>>> keep planning to. I know exactly what Antonio is saying, so I'm going
>>> to try and give another example of how things work in Java. Maybe
>>> seeing this will help you IDL folks to better understand the Java side
>>> of the question. I'm going to be using Java code in my example, so I
>>> hope you can follow it. ;-)
>>
>>
>> Thank you for trying to shed light on this, Michael.
>> I can read your code well enough. What I can't follow
>> is why Antonio thinks this can't be done in IDL. :-)
>
> I think Antonio's confusion came from his experience with languages like
> C++ and Java, which have a different object model from IDL. In C++ and
> Java, the fact that two classes have a method called Draw does not imply
> these methods are related. For them to be related, the classes have to
> have a common superclass which itself has a Draw method. The
> superclass's Draw method will often be virtual, ie. not implemented, but
> it has to exist.
Did you mean "abstract" here? Virtual methods are what all IDL methods
are: overrideable in a sub-class.
JD
|
|
|