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

Home » Public Forums » archive » Object style guide
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Object style guide [message #17739] Fri, 12 November 1999 00:00
m218003 is currently offline  m218003
Messages: 56
Registered: August 1999
Member
Hi all,

seems there is more and more activity going on objectwise these
days and some people try to standardize things. Looking at some of the
examples posted recently, I thought of two things (besides trying to
figure out what you folks did):

(1) The common procedure header seems inappropriate for object design,
e.g. what is a "CALLING SEQUENCE" for an object?

(2) There is a basic structure to all *__define.pro files which one
should not have to retype all the time.

Gee!, I thought, here's a template that addresses both. It provides a
new file header structure (which is still format-compatible with the
old "analogue" one), and it provides a basic skeleton for any object
definition. Under Unix you can easily use it like:
sed 's/%NAME%/MyObject/' template__define.pro > myobject__define.pro
and you will find a file that awaits to become alive by you. On Windows
systems you will have to do a find/change and replace %NAME% by your
favorite, then "Save as ...".

I'd be extremely happy if (especially) the gurus among you would find it
equally useful to adopt a new format for the file header in object
definition routines. The attached file should serve as a basis for
discussion, I am open for any suggestions.

Cheers,
Martin in objectland ;-)


--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[

; Object definition
;----------------------------------------------------------- --
;+
; NAME:
; %NAME%
;
; PURPOSE:
;
; CATEGORY:
;
; PROPERTIES:
; public properties:
; private properties:
;
; METHODS:
; public methods:
; GetProperty
; SetProperty
; Show
; Init
; Cleanup
; private methods:
;
; DESCRIPTION:
;
; INTERFACES:
;
; SIDE EFFECTS:
;
; MODIFICATION HISTORY:
;-
; Copyright
;----------------------------------------------------------- --


; ************************************************************ **********
; ************************************************************ **********
; Get Properties of %NAME%
;
pro %NAME%::GetProperty, $
_ref_extra=extra

; Fill in lines along
; if arg_present(KEYWORD) then KEYWORD = self.KEYWORD

end ; %NAME%::GetProperty


; ************************************************************ **********
; ************************************************************ **********
; Set Properties of %NAME%
;
pro %NAME%::SetProperty, $
_ref_extra=extra

; Fill in lines along
; if n_elements(KEYWORD) eq 1 then self.KEYWORD = fix(KEYWORD)

end ; %NAME%::SetProperty


; ************************************************************ **********
; ************************************************************ **********
; Display %NAME%
;
pro %NAME%::Show

end ; %NAME%::Show


; ************************************************************ **********
; ************************************************************ **********
; Cleanup method
;
pro %NAME%::CleanUp


print,'%NAME%::CleanUp'

end ; %NAME%::CleanUp


; ************************************************************ **********
; ************************************************************ **********
; Initialization method
;
function %NAME%::Init, $
_ref_extra=extra


success = 0

; check inputs and set defaults
; Fill in lines along
; if n_elements(KEYWORD) eq 0 then KEYWORD = 0L
; self.KEYWORD = KEYWORD
; success = 1

return,success

end ; %NAME%::Init


; ************************************************************ **********
; ************************************************************ **********
; Structure definition
;
pro %NAME%__Define

temp = {%NAME%, $
dummy:-1 }

end ; %NAME%__Define
[Message index]
 
Read Message
Previous Topic: Re: Alpha/UNIX rehosting question
Next Topic: Zoom

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

Current Time: Wed Oct 08 19:05:55 PDT 2025

Total time taken to generate the page: 0.00529 seconds