VOResource v1.0 IWD

Arnold Rots arots at head.cfa.harvard.edu
Fri Jun 10 10:58:37 PDT 2005


Yes, that is an obvious solution, but then you lose any support there
may be for the datetime data type, particularly when communicating
with databases.

  - Arnold

PS: One of the problems with unions is that type information may get
lost.  In this particular example that is not the case since there is
no overlap in the allowed strings, but if there is overlap it may not
be possible to determine which datatype from the union is being used.
To take a silly example: if one made a union of decimal, octal, and
hexadecimal numbers, it would be clear what "1A" is, but "10" would be
very ambiguous.

Ed Shaya wrote:
> Ray Plante wrote:
> 
> >Hey Arnold
> >
> >Thank you, thank you, very much for your careful reading!
> >
> >On Thu, 9 Jun 2005, Arnold Rots wrote:
> >  
> >
> >>In Section 2.2 you define UTCDateTime.  I think it is the only place
> >>where you use a union and I wonder whether that is a good choice.
> >>It is obviously tempting, but my impression is that code generators
> >>are not universally happy with it since it makes for a rather
> >>indeterminate polymorphism.
> >>    
> >>
> >
> >I am concerned about this for the same reason.  This definition was lifted 
> >from the OAI schema which was addressing the same requirement: to support 
> >dates either with or without the hms part.  This is one of the things we 
> >need to test with existing code generators.
> >  
> >
> 
> We just use a regex for DateTime and make the hms optional.
> Ed
> 
--------------------------------------------------------------------------
Arnold H. Rots                                Chandra X-ray Science Center
Smithsonian Astrophysical Observatory                tel:  +1 617 496 7701
60 Garden Street, MS 67                              fax:  +1 617 495 7356
Cambridge, MA 02138                             arots at head.cfa.harvard.edu
USA                                     http://hea-www.harvard.edu/~arots/
--------------------------------------------------------------------------



More information about the registry mailing list