eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[pivot] Rationalize Property.default #1145

Open eclipse-ocl-bot opened 3 weeks ago

eclipse-ocl-bot commented 3 weeks ago

| --- | --- | | Bugzilla Link | 412913 | | Status | NEW | | Importance | P3 normal | | Reported | Jul 14, 2013 02:19 EDT | | Modified | Jan 19, 2019 10:06 EDT | | See also | 543608, 471856 | | Reporter | Ed Willink |

Description

In UML

Property.defaultValue is a ValueSpecification\ Property.default is a derived String value \ body: if self.type = String then defaultValue.stringValue() else null endif

(derivation expressions are vaguely resolved by Constraints)

In Ecore

EStructuralFeature.defaultValueLiteral is an EString\ EStructuralFeature.defaultValue is a derived EJavaObject\ (the type-specific interpretation of defaultValueLiteral)\ EStructuralFeature.eAnnotations are used for derivation expressions

In Pivot

Property.default is a (non-derived) String value \ Property.defaultExpression is an OpaqueExpression


Pivot should be efficient and so let

if Property.default is set

Property.default is a derived known constant Object value, which may be null. This is the result of parsing defaultExpression and discovering it to be a constant.

else

Property.defaultExpression is an OpaqueExpression for the initial/derivation expression

The OpaqueExpression is lazily parsed to an ExpressionInOCL on first access.

eclipse-ocl-bot commented 3 weeks ago

By Ed Willink on Jan 19, 2019 10:04

Bug 543608 considers the related Complete OCL Property init:/der: constructs.