On Wed, 14 Jan 2009, Peter W. Draper wrote:
>> Is there any documentation (or source file) describing the parameter
>> systems used by the Java tools such as TopCat and SPLAT that Peter
>> and/or Mark could direct me to?
>
> SPLAT just uses a simple system for dealing with arguments, hardly worth
> mentioning.
ditto TOPCAT.
STILTS however uses a quite sophisticated parameter system which
is contained in the starjava TASK package (uk.ac.starlink.task classes).
You can see javadocs at, e.g.,
http://andromeda.star.bris.ac.uk/starjavadocs/uk/ac/starlink/task/package-summary.html
This features parameters which are self-describing objects, so that the
implementation of each java Parameter object itself contains
appropriate default values, validation code, various levels of
documentation, rules about how to turn parameter string values
into parameter-specific object outputs, etc.
These parameter objects interact with an Environment (the basic
interaction is for the parameter to obtain zero or more string values
from the environment) which may be implemented in various different ways;
the standard one is use of command-line parameters with optional
ADAM-like prompting as appropriate.
However I have since implemented environments which allow the
applications to run unaltered behind a servlet or a CEA application
server instead - this isn't a lot of effort.
This framework allows much of the application documentation
(all the Usage sections in the user document, here:
http://www.starlink.ac.uk/stilts/sun256/cmdUsage.html
as well as command-line interactive help) to be generated automatically
at build time.
The same framework is used for the now moribund NDTOOLS package
(which is what I wrote it for in the first place).
The design is heavily influenced by ADAM, but with some changes:
for instance the defaulting mechanism is a lot less involved,
and the OO-ness of Java is put to good use.
Mark
--
Mark Taylor Astronomical Programmer Physics, Bristol University, UK
[log in to unmask] +44-117-928-8776 http://www.star.bris.ac.uk/~mbt/
|