Define inheritance for enumeration types

    • Type: Improvement
    • Resolution: No Action
    • Priority: Major
    • V4.01_WD01
    • Affects Version/s: V4.0_CS01
    • Component/s: CSDL XML
    • Environment:

      Enum Types, Closed without Action

    • Hide

      Proposed
      Proposal Allow EnumType to specify a BaseType to which the EnumType will add new members. BaseType and UnderlyingType cannot be both specified, the UnderlyingType.

      In metadata annotations the EnumMember syntax requires prefixing the member name with the fully qualified type name in all cases, so there's no ambiguity if the same base enum type is extended by more than one other enum type.

      For properties and instance annotations in request and response bodies enum members are represented only as the member name without the type name prefix if the member is defined by the declared type of the property. Members of a derived type must be prefixed with the qualified type name. This is consistent with the metadata annotation syntax and the URL syntax for accessing properties of derived types:

      "PrimaryColor":"Yellow"
      "SecondaryColor":"org.example.ExtendedPattern/DarkRed"

      Show
      Proposed Proposal Allow EnumType to specify a BaseType to which the EnumType will add new members. BaseType and UnderlyingType cannot be both specified, the UnderlyingType. In metadata annotations the EnumMember syntax requires prefixing the member name with the fully qualified type name in all cases, so there's no ambiguity if the same base enum type is extended by more than one other enum type. For properties and instance annotations in request and response bodies enum members are represented only as the member name without the type name prefix if the member is defined by the declared type of the property. Members of a derived type must be prefixed with the qualified type name. This is consistent with the metadata annotation syntax and the URL syntax for accessing properties of derived types: "PrimaryColor":"Yellow" "SecondaryColor":"org.example.ExtendedPattern/DarkRed"

      We currently don't have a way for adding values to an enumeration type. This would be helpful for defining custom vocabularies that extend base vocabularies.

      It's sort of inheritance for enumerations, given the fact that some programming languages implement enumerations as classes/objects with members/properties for the enumeration values.

      So we could add an attribute "BaseType" or "Extends" for EnumType to add new enumeration values.

            Assignee:
            handl
            Reporter:
            handl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: