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

Home » Public Forums » archive » Re: When should objects be used?
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: When should objects be used? [message #15953 is a reply to message #15940] Fri, 25 June 1999 00:00 Go to previous messageGo to previous message
mallors is currently offline  mallors
Messages: 76
Registered: November 1997
Member
In article <3772CE57.6BF093C8@wellesley.edu>,
"Richard G. French" <rfrench@wellesley.edu> writes:
> Nearly all of my IDL programs started as interactive bits of code, saved
> in
> a journal file and then expanded into programs. The main power of IDL
> for me is to be able to tinker with the code quite easily, try different
> things out, and then finalize the code in the fashion that works best.
> Most of these programs are the old-fashioned kind where you specify the
> conditions at the start (the data to be
> analyzed, the conditions of the analysis, the form of the result) and

[text omitted]

Hi,

I think the experts here in this group have probably given
you enough info to peak your interest, but I just want to point
out that one of the most useful features of object oriented
programming is "code reuse". Unfortunately, for the type of
exploratory science analysis you describe, it is sometimes
difficult to decide what procedures would (or could) be suitable
to be made into objects. I have found that for a lot of data
analysis code that no one but yourself will be using, a full
blown object-oriented design is not usually acceptable.

On the other hand, keep in mind that if you can write some
useful utility objects, you can use them easily within your
"old" procedural method of programming. For example, I was
finding myself always manipulating my data file names, extracting
the path, the file extension, etc. This type of task is perfect
for encapsulation into an object, so I created a simple "File"
object. This object can then be used anywhere in IDL - you don't
have to have an super-duper full object oriented program.
Perhaps the task you mention of writing TeX tables might be a
good place to start:

Table = OBJ_NEW ('teXTable') ; Make an instance of a 'teXTable' obj
Table->setColumns (5) ; This table will have 5 cols.
Table->setData (myData) ; myData might be an array of structures
; with 5 tags. You could even omit the
; setColumns() method, and just figure
; out the number of columns
Table->write ('myTable.tex') ; Write a table
OBJ_DESTROY (Table) ; Clean up memory

This object could then produce TeX tables for any of your datasets,.
Come to think of it, I would like to have this object...why don't
you post it when it's done ;-)


Regards,

-bob

By the way, you can take a look at the File object on my
web page: http://cspar.uah.edu/~mallozzir/software/idl/idl.html




--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
Robert S. Mallozzi 256-544-0887
Mail Code SD 50
Work: http://gammaray.msfc.nasa.gov/ Marshall Space Flight Center
Play: http://cspar.uah.edu/~mallozzir/ Huntsville, AL 35812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
[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
Previous Topic: Re: Conflicting Data structures
Next Topic: Re: repeat.. until loops

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

Current Time: Sun Oct 12 05:10:57 PDT 2025

Total time taken to generate the page: 0.48045 seconds