comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: What about real polymorphism ??
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: What about real polymorphism ?? [message #41971 is a reply to message #41968] Thu, 09 December 2004 12:52 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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. :-)

Let me give you an example I use every day in IDL and
see if this isn't exactly the flavor of your example.

I have a draw widget object. I tell the object to
"draw itself" by calling its DRAW method. The draw
method does nothing more than call the DRAW methods
of any objects that happen to be in the draw widget's
container. That is to say, the draw widget object NEVER
knows what it is drawing! If I want something displayed
in the window, I just give it a DRAW method and plop it
into the Draw widget, which can always display it. It
doesn't have to know anything whatsoever about what kind
of objects populate its container.

So, in Antonio's case, if he wants to treat his MEN
and WOMEN objects as "people", the more power to him.
Anyone who interacts with one of his "people" is going
to find the proper method called without him having to
do anything extra about it. That seems like perfect
polymorphism to me. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stretching an image
Next Topic: ENVI and ROIs

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 22:42:16 PDT 2025

Total time taken to generate the page: 1.84154 seconds