Issue 13057: Section: 7.5.15 (ocl2-rtf) Source: (, ) Nature: Enhancement Severity: Significant Summary: Although it is clear that using a constructor to write an object to the system being modelled breaks the property of being side-effect free, it would be useful to return new objects as a result of the query functionality of OCL. It is possible to create a new Tuple for return from a function. For example: def: newDate1() : TupleType {day:Integer, month:Integer, year:Integer} = Tuple{day=10, month=12, year=1950}; It would be useful to have a similar way to generate a query result, but with a complex data type instead of a Tuple. For example: def: newDate2() : Date = Date{day=10, month=12, year=1950}; Rather than write this object to the model under query, it would only be returned as a query result so, under these circumstances, would not break the property of being side-effect free. This feature would be extremely useful to the HL7 GELLO project, which works with data models defined in absense of defined methods or constructors. If this feature were to only apply to classes marked in some way to guarantee they have no side-effects from construction then that would remain useful. Resolution: Revised Text: Actions taken: November 5, 2008: received issue Discussion: Resolution of this issue requires some extra analysis. Disposition: Deferred End of Annotations:===== m: webmaster@omg.org Date: 05 Nov 2008 05:56:07 -0500 To: Subject: Issue/Bug Report -------------------------------------------------------------------------------- Name: Craig Lucas Company: InferMed mailFrom: craig.lucas@infermed.com Notification: Yes Specification: Object Constraint Language (OCL) Section: 7.5.15 FormalNumber: formal/2006-05-01 Version: 2.0 RevisionDate: 05/01/2006 Page: 24 Nature: Enhancement Severity: Significant HTTP User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322) Description Although it is clear that using a constructor to write an object to the system being modelled breaks the property of being side-effect free, it would be useful to return new objects as a result of the query functionality of OCL. It is possible to create a new Tuple for return from a function. For example: def: newDate1() : TupleType {day:Integer, month:Integer, year:Integer} = Tuple{day=10, month=12, year=1950}; It would be useful to have a similar way to generate a query result, but with a complex data type instead of a Tuple. For example: def: newDate2() : Date = Date{day=10, month=12, year=1950}; Rather than write this object to the model under query, it would only be returned as a query result so, under these circumstances, would not break the property of being side-effect free. This feature would be extremely useful to the HL7 GELLO project, which works with data models defined in absense of defined methods or constructors. If this feature were to only apply to classes marked in some way to guarantee they have no side-effects from construction then that would remain useful.