[QUANTITY] Why quantities always have errors (Was: Re: [QUANTIT] Use-cases, role in larger scheme)

Brian Thomas brian.thomas at gsfc.nasa.gov
Mon Nov 17 09:30:22 PST 2003


On Monday 17 November 2003 12:14 pm, DIDELON Pierre wrote:
> If you have to pass a parameter to an application, to specify some input
> value, you may need to transmit a value (without error), it can even be a
> flag. This is a very immediat example, and we can not rule out in VO (IMO),
> the usage of numbers without error, once for all,
> even if today it seems more natural to you,
> SOME PEOPLE outside here want to use numbers without errors,
> and ask for that possibility several times on the list (and off the list),
> and it would certainly be appropriate in some cases.

	This can be resolved by simply choosing a sensible default meaning
	for the error == NULL.

	I suggest that if an error isnt present (e.g. returns null), then its meaning 
	is "error, unknown". If you want to create a 'constant' then you would get
	something else, e.g. quantity->getError() returns "ExactNoError" class.

	And its a pretty trivial detail of construction of the class, I think in terms
	of implementation. Say you want to create 2 classes that embody "hardwired"
	errors (so implementer doesnt need to thinik about the errors), such as 
	"constant" and "parameter",  then, assuming a quantity interface, we have:

	class Constant implements Quantity {

	ErrorType getError () {
		return new ErrorExact();
	}

	}

	and for your "parameter":

	class Parameter implements Quantity {

	ErrorType getError() {
		return new UnknownError();
	}

	}

	Regards,

		=b.t.


-- 

  * Dr. Brian Thomas 

  * Code 630.1 
  * Goddard Space Flight Center NASA

  *   fax: (301) 286-1775
  * phone: (301) 286-6128




More information about the dm mailing list