[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [OASIS Issue Tracker] Updated: (ODATA-365) Rename edm:AssertType to edm:Cast and clearify behaviour
[ http://tools.oasis-open.org/issues/browse/ODATA-365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Zurmuehl updated ODATA-365: ---------------------------------- Summary: Rename edm:AssertType to edm:Cast and clearify behaviour (was: Rename edm:AssertType to edm:CastToType and clearify behaviour) Description: In most programming languages, an assertion is a predicate (a true-false statement) placed in a program to indicate that the developer *thinks* that the predicate is always true at that place. If the assertion is false, an assertion failure results, which typically causes execution to abort. In contrast the dynamic expression edm:AssertType behaves different: It casts the value of the child expression to the specified type. So the name edm:Cast would express this behaviour better. We must define the behaviour if the cast fails: I propose to return the NULL value as result of dynamic expression. The third proposal is to provide a more informative example in the specification, e.g. <Annotation Term="org.example.display.Threshold"> <Cast Type="Edm.Decimal"> <Path>Average</Path> </Cast> </Annotation> assume Average is of type edm:String an the Term is of type edm:PrimitiveType was: In most programming languages, an assertion is a predicate (a true-false statement) placed in a program to indicate that the developer *thinks* that the predicate is always true at that place. If the assertion is false, an assertion failure results, which typically causes execution to abort. In contrast the dynamic expression edm:AssertType behaves different: It casts the value of the child expression to the specified type. So the name edm:CastToType would express this behaviour better. We must define the behaviour if the cast fails: I propose to return the NULL value as result of dynamic expression. The third proposal is to provide a more informative example in the specification, e.g. <Annotation Term="org.example.display.Threshold"> <AssertType Type="Edm.Decimal"> <Path>Midpoint</Path> </AssertType> </Annotation> assume Midpoint is of type edm:String an the Term is of type edm:PrimitiveType > Rename edm:AssertType to edm:Cast and clearify behaviour > -------------------------------------------------------- > > Key: ODATA-365 > URL: http://tools.oasis-open.org/issues/browse/ODATA-365 > Project: OASIS Open Data Protocol (OData) TC > Issue Type: Improvement > Components: OData Protocol > Affects Versions: V4.0_CSD01 > Environment: [Proposed] > Reporter: Martin Zurmuehl > Fix For: V4.0_CSD02 > > > In most programming languages, an assertion is a predicate (a true-false statement) placed in a program to indicate that the developer *thinks* that the predicate is always true at that place. If the assertion is false, an assertion failure results, which typically causes execution to abort. > In contrast the dynamic expression edm:AssertType behaves different: It casts the value of the child expression to the specified type. So the name edm:Cast would express this behaviour better. We must define the behaviour if the cast fails: I propose to return the NULL value as result of dynamic expression. > The third proposal is to provide a more informative example in the specification, e.g. > <Annotation Term="org.example.display.Threshold"> > <Cast Type="Edm.Decimal"> > <Path>Average</Path> > </Cast> > </Annotation> > assume Average is of type edm:String an the Term is of type edm:PrimitiveType -- 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]