-
Key: OCL25-15
-
Legacy Issue Number: 13057
-
Status: open
-
Source: InferMed Ltd ( Craig Lucas)
-
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.
-
Reported: OCL 2.0 — Wed, 5 Nov 2008 05:00 GMT
-
Updated: Tue, 20 Jun 2017 08:00 GMT