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

Home » Public Forums » archive » Need advice about inheritance
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: Need advice about inheritance [message #44183 is a reply to message #44098] Mon, 23 May 2005 08:13 Go to previous messageGo to previous message
wcramer is currently offline  wcramer
Messages: 9
Registered: February 2005
Junior Member
>> Only for curiosity. ADD returns a new instance or the same instance
with
the addition?
>> Yes, don't write an "ADD" method for TIMEDATA and use the inherited
from
DATA.

ADD returns a new instance. I use OBJ_NEW("data",...) to create the new
instance. How do I get the ADD method of the DATA class to return a
TIMEDATA without copying the code to the TIMEDATA class and changing
the OBJ_NEW call? Is it proper to get the current class type string
(OBJ_CLASS(self)) and use that in the OBJ_NEW call, or is there a
better way?

>> Perhaps you can use keyword parameters in addition to some kind of
"template pattern". That is, you need your DATA::Init and
TIMEDATA::Init has the same positional parameters in addition to their
respective keyword parameters. Now, you can call OBJ_NEW('DATA', d1) or
OBJ_NEW('TIMEDATA', d1, XX=d2) because they have the same parameters.

Althought this would work, I was hoping that I could set up the
TIMEDATA class such that a user wouldn't have to know anything about
"X" and "Y" and would only deal with "TIME" and "VALUE" (even though
the data is stored the same). I suppose that I'm looking for a perfect
solution that doesn't exist.

Thanks,
Doug
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: array of pointers inside a structure
Next Topic: Re: mosaic two images in direct graphics

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

Current Time: Sat Oct 11 07:56:02 PDT 2025

Total time taken to generate the page: 0.00253 seconds