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] Updated: (ODATA-119) Allow definition of "simple" types that fix values for facet attributes of primitive types

     [ http://tools.oasis-open.org/issues/browse/ODATA-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Pizzo updated ODATA-119:

Support a new TypeDefinition element for defining new simple types. TypeDefinitions specify a name, underlying types, and zero or more facets applicable to that type.
-TypeDefinitions cannot derive from base type definitions.
-TypeDefinitions can be used wherever a simple type is used (other than as the underlying type in a new TypeDefinition), and are type-comparable with their underlying types and any TypeDefinitions defined using the same underlying type. 
-Additional facets appropriate for the underlying type may be specified in the usage, but the facets specified in the typedefinition must not be respecified.
-Annotations may be applied to a TypeDefinition, and are considered applied wherever the TypeDefinition is used. Applying the same annotation to a property whose TypeDefinition already defines that annotation is an error.
-Where TypeDefinitions are used, the type definition is returned in place of the primitive type wherever the type is specified in a response.
<TypeDefinition Name="Length" UnderlyingType="Edm.Int32" Nullable=false>
  <Annotation Term="Org.Odata.Measurements.V1.Units" String="Centimeters"/>
<TypeDefinition Name="Weight" UnderlyingType="Edm.Int32" Nullable=false>
  <Annotation Term=" Org.Odata.Measurements.V1.Units" String="Kilograms"/>
<ComplexType Name="Size">
  <Property Name="Height" Type="Self.Length" />
  <Property Name="Weight" Type="Self.Weight" />

Add <edm:SimpleType> element, which can be a direct child of the <edm:Schema> element.
This element has attributes for Name and BaseType, and supports the same Property Facets as the <edm:Property> element. BaseType must be a built-in primitive type or another "custom defined simple type". Custom defined simple types can be used anywhere primitive types are used.

    Environment: [Proposed]

Updated proposal to use rules/semantics of typedefs.
-"TypeDefinitions" are type-comparable with the underlying type and other TypeDefinitions defined from the same underlying type, and can be used anywhere the underlying type can be used (other than as an underlying type for a TypeDefinition).
-Simplified design by saying TypeDefinitions could not derive from other TypeDefinitions; added complexity without a lot of perceived value.
-It's an error to redefine a facet in the usage of a typedefinition that was specified in the definition of the typedefinition.
-Annotations applied to TypeDefinitions are applied where typedefinitions are used, just like facets.

> Allow definition of "simple" types that fix values for facet attributes of primitive types
> ------------------------------------------------------------------------------------------
>                 Key: ODATA-119
>                 URL: http://tools.oasis-open.org/issues/browse/ODATA-119
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: New Feature
>          Components: OData CSDL v1.0
>    Affects Versions: WD01
>         Environment: [Proposed]
>            Reporter: Ralf Handl
>            Assignee: Michael Pizzo
>            Priority: Minor
>             Fix For: WD01
> It would be helpful if we could define "simple" types that are based on primitive types. This would be useful for providing values for facet attributes in one place:
> <SimpleType Name="Char80" BaseType="Edm.String" MaxLength="80" FixedLength="true" />
> <SimpleType Name="AmountInFInancialReportingCurrency" BaseType="Edm.Decimal" Precision="30" Scale="2" />

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]