eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[pivot] Rationalize ExpressionInOCL, Parameter/ParameterVariable, this #2088

Open eclipse-ocl-bot opened 3 weeks ago

eclipse-ocl-bot commented 3 weeks ago

| --- | --- | | Bugzilla Link | 551822 | | Status | NEW | | Importance | P3 normal | | Reported | Oct 07, 2019 03:09 EDT | | Modified | Nov 09, 2022 08:18 EDT | | Blocks | 509309 | | See also | 439013, 481664, 541380, 579109, 580356, Gerrit change 196833 | | Reporter | Ed Willink |

Description

Bug 481664 struggles with the uncomfortable QVTb derivation of Function from Operation with Function attempting to have a simple OCLExpression body, while Operation emulates part of UML's bodyCondition Constraint with an ExpressionInOCL/LanguageExpression body.

In isolation ExpressionInOCL is good providing a wrapping context, but when embedded in Operation/Function it is bloat repeating the container's context.

The bloat uses ParameterVariable referencing Parameter, whicj might be necessary if ParameterVariable could be different to Parameter, but in OCL the variables are initialized on construction and are thereafter immutable. THe complexity of multi-valued nested operations is handled by using the VariableDeclaration as a key to the loval environment. ParameterVarible should not be necessary.

a) Introduce ConcreteExpressionInOCL / DelegatingExpressionInOCL derivations one with the local context, the other with the container's context.

b) Let Operation inherit from ExpressionInOCL to eliminate the bloat. ?? Property too ??

b) is a simplification, but non-trivial multiple inheritance can have unpleasant corrolaries.

eclipse-ocl-bot commented 3 weeks ago

By Ed Willink on Oct 08, 2019 13:22

Bug 481664 introduced a FunctionBody and made the tx this context a Parameter while generalising many Variable/Parameter to VariableDeclaration.

done in 2019-12M1

(In reply to Ed Willink from comment #0)

b) Let Operation inherit from ExpressionInOCL to eliminate the bloat. ?? Property too ??

b) is a simplification, but non-trivial multiple inheritance can have unpleasant corrolaries.

to do.

eclipse-ocl-bot commented 3 weeks ago

By Ed Willink on Mar 02, 2022 02:25

The ExpressionInOCL/LanguageExpression was perhaps an improvement when attempting to have strong alignment with UML's OpaqueExpression. It is actualy a major pain since a lazy mutation is necessary as a parsed LanguageExpression is reclassed as an ExpressionInOCL requiring special casing in the ASResourceImpl.ImmutabilityCheckingAdapter (See BUg 541380#c5)

Eliminate at least all concrete use of LanguageExpression, and probably all use since it only adds a body but no context or patameters. Perhaps the interface stays but probably a richer interface folded into its Operation consumer.

eclipse-ocl-bot commented 3 weeks ago

By Ed Willink on Mar 06, 2022 06:09

(In reply to Ed Willink from comment #2)

a lazy mutation is necessary as a parsed LanguageExpression is reclassed as an ExpressionInOCL requiring special casing in the ASResourceImpl.ImmutabilityCheckingAdapter (See BUg 541380#c5)

See Bug 579109 fr ImmutabilityCheckingAdapter rationalization, transient properties.

eclipse-ocl-bot commented 3 weeks ago

By Ed Willink on Jul 08, 2022 05:50

(In reply to Ed Willink from comment #0)

The bloat uses ParameterVariable referencing Parameter, whicj might be necessary if ParameterVariable could be different to Parameter, but in OCL the variables are initialized on construction and are thereafter immutable.

No. See Bug 580356.

The definition (Operation/Transformation) has a context Parameter.

The implementation (ExpressionInOCL/Rule) has a context ParameterVariable whose representedParameter is the context Parameter.

Failure to observe this Parameter / Variable distinction leads to unpleasantness vagueness and pragmatism through dubious VariableDeclaration polymorphism.

eclipse-ocl-bot commented 3 weeks ago

Nov 09, 2022 08:18

New Gerrit change created: https://git.eclipse.org/r/c/ocl/org.eclipse.ocl/+/196833