OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] Issue Comment Edited: (ODATA-395) Simplify rule for implicit values of enumeration members


    [ http://tools.oasis-open.org/issues/browse/ODATA-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33474#action_33474 ] 

Stefan Drees edited comment on ODATA-395 at 5/17/13 6:57 AM:
-------------------------------------------------------------

The number Zero should be a good default first value. In a context where the number One is natural, one can left-pad the range with say UNUSED or NULL (...) and enter the "real domain" starting at second entry or explicitly set all values. If starting with a default of One, a Zero frantic community would be forced to explicitly set each value.

It is not so simple to map Hubert's extension idea of first-may-have-special-hint into xml schema, right? So if this is complicated to XSDalize, I am all for "All or nothing" ;-) 

PS: EnumTypes - a spartanic perspective
The massive discussion threads on python-ideas and python-dev mailing lists preceding the (final) extension of python with an EnumType [1] after nearly a decade of prior efforts to me shows, how complex a simple subject starting as enumeration(!) can become, when you try to mix in spicy referencing and cast away the uniqueness. 
The abstract of the current accepted python enhancement proposal perfectly states my more spartanic view on the topic: """An enumeration is a set of symbolic names bound to unique, constant values. Within an enumeration, the values can be compared by identity, and the enumeration itself can be iterated over.""" (cf. [1]) So keeping it simple: """[...] useful for defining an immutable, related set of constant values that may or may not have a semantic meaning[...]""" (ibid). 

[1]: http://www.python.org/dev/peps/pep-0435/

      was (Author: sdrees):
    The number Zero should be a good default first value. In a context where the number One is natural, one can left-pad the range with say UNUSED or NULL (...) and enter the "real domain" starting at second entry or explicitly set all values. If starting with a default of One, a Zero frantic community would be forced to explicitly set each value.

It is not so simple to map Hubert's extension idea of first-may-have-special-hint into xml schema, right? So if this is complicated to XSDalize, I am all for "All or nothing" ;-) 
  
> Simplify rule for implicit values of enumeration members
> --------------------------------------------------------
>
>                 Key: ODATA-395
>                 URL: http://tools.oasis-open.org/issues/browse/ODATA-395
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Improvement
>          Components: OData CSDL
>    Affects Versions: V4.0_CSD01
>         Environment: [Proposed]
>            Reporter: Ralf Handl
>             Fix For: V4.0_CSD02
>
>
> Enumeration members have an optional Value attribute for specifying an integer equivalent to the symbolic member name that is for ordering.
> The current rule for implicitly numbering the enumeration members is cloned from the C family of programming languages and allows specifying values for some members while having the other members being numbered implicitly. This can lead to surprising results for the uninitiated:
> <EnumType Name="ShippingMethod">
>   <Member Name="VIP"/>
>   <Member Name="FirstClass"/>
>   <Member Name="TwoDay" Value="0"/>
>   <Member Name="Overnight"/>
> </EnumType>
> The result is that both VIP and TwoDay get the value zero and both FirstClass and Overnight get the value 1.
> While we see value in having Value optional, we see no value in providing a value for some members only.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]