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

Home » Public Forums » archive » Re: Copying (Duplicating) Objects
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: Copying (Duplicating) Objects [message #31022] Thu, 06 June 2002 14:38 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Randall Skelton" <rhskelto@atm.ox.ac.uk> wrote in message
news:Pine.LNX.4.33.0206061044560.10439-100000@mulligan.atm.o x.ac.uk...

> I agree with Ben... I too use Martin's copy method and it works very
> well. It does have problems when you try and clone a class that has
> requried positional parameters though as internally it relies on
> 'clone = obj_new( obj_class(self) )'. My 'I do not have time to
> think about this now' solution was to make classes with no required
> positional parameters and write an 'isValid' method that ensures the
> object is correctly populated with 'quasi-required' parameters
> before it is used. Of course, failing to use positional arguments
> for required parameters goes against some well established IDL
> programming conventions and therefore tends to upset some of the IDL
> Expert Programmer's Association Executive Committee members ;)

Well, I can't comment on that since the IEPAEC has unaccountably
failed to invite me to join. But just to spin this thread out a little
longer, I would like to make a couple of observations:

- Few, if any, standard IDL classes require parameters during
initialisation

- Where standard IDL classes have positional parameters, they tend
to "echo" them with keyword parameters.

The first means that you can create a blank object then set its
properties later. Allowing for this is good OO practice IMHO. The
second lets you take advantage of the power of IDL's keyword handling
(inheritance, keyword-structure equivalence).

--
Mark Hadfield "Ka puwaha et tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: VIP, Julday
Next Topic: Re: Multiple PS-files?

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

Current Time: Wed Oct 08 15:33:16 PDT 2025

Total time taken to generate the page: 0.00706 seconds