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] (ODATA-894) Support complex property overwriting in derived type


    [ https://issues.oasis-open.org/browse/ODATA-894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61427#comment-61427 ] 

Mark Stafford commented on ODATA-894:
-------------------------------------

I have such mixed feelings on this type of issue. On the one hand I think we've overspecified OData in many respects and I like the idea of enabling more flexible models. On the other hand, the more flexible we make things, the more difficult it is to have good generic support for OData APIs.

My primary feedback:
We should not approach this as a complex type issue. I don't like the distinction between complex type and entity type at all. Rather than create more differences, we should see if there's a need for a broader solution here... e.g., Derived types should be able to further constrain any property. Primitive properties could be further constrained by adding facets, as Ralf points out, or by substituting the type for a TypeDefinition whose base type matches the original primitive property type. Navigation properties could be further constrained in the same way this issue hopes to constrain structural properties.

> Support complex property overwriting in derived type
> ----------------------------------------------------
>
>                 Key: ODATA-894
>                 URL: https://issues.oasis-open.org/browse/ODATA-894
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Bug
>          Components: OData CSDL, OData JSON CSDL
>    Affects Versions: V4.0_ERRATA02
>         Environment: [Proposed]
>            Reporter: Michael Pizzo
>             Fix For: V4.01_WD01
>
>
> Today we allow types to derive from base types and define new properties, but we don't allow overriding existing complex typed properties with derived complex typed properties.
> That means I can define a type FOO with property bar of type BAR:
> <EntityType Name="FOO" IsAbstract="True">
>     <Property Name="bar" Type="ns.BAR"
> </EntityType>
> <ComplexType Name="BAR">
>   <Property Name="property1" Type="Edm.String"/>
> </ComplexType>
> I can define type FOO2 that adds required properties to FOO, and I can define type BAR2 that adds required properties to BAR:
> <EntityType Name="FOO2" BaseType="ns.FOO">
>     <Property Name="requiredOnFOO2" Type="Edn.String" Nullable="false"/>
> </EntityType>
> <ComplexType Name="BAR2" BaseType="ns.BAR">
>   <Property Name="requierdpropertyOnBAR2" Type="Edm.String" Nullable="false"/>
> </ComplexType>
> But I can't add require that instances of FOO2 have the required properties of BAR2 (i.e., that property bar be of type BAR2).
> What we would need to do in order to support this is to allow a property in a derived type to override a complex-typed property of the base type with a complex type that is derived from the type of the property in the base type.
> For example:
> <EntityType Name="FOO2" BaseType="ns.FOO">
>     <Property Name="bar" Type="ns.BAR2" />
> </EntityType>
> The definition of "bar" in FOO2 overrides the definition of "bar" in FOO, meaning that any property "bar" of an instance of FOO2 must be of type BAR2.



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


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