eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[cg] Provide GenModel support for statics #2227

Open eclipse-ocl-bot opened 4 days ago

eclipse-ocl-bot commented 4 days ago

| --- | --- | | Bugzilla Link | 578199 | | Status | NEW | | Importance | P3 normal | | Reported | Jan 13, 2022 07:14 EDT | | Modified | Feb 17, 2023 01:54 EDT | | See also | 285771, 534421, 579830, Gerrit change 196708, 581543 | | Reporter | Ed Willink |

Description

Two attempts at not-tweaking the JET templates for static properties failed.

a) using an EOperation/EStructuralFeature EAnnotation works fine for editing/round-trip but requires the suppression of the feature during genmodel to avoid 'spurious' CG. This leaves the Java loading from XXXPackageImpl deficient and so OCL references fail to resolve.

b) Using an EAnnotation wrapper can work but the synthesis of the XXXPackageImpl fails to represent the EAnnotation contents.

Why not just tweak the already custom OCL variant of Class.javajet to add the static keyword?

eclipse-ocl-bot commented 4 days ago

By Ed Willink on May 04, 2022 08:06

The prevailing approach of hiding the features with UML static EAnnotations during genmodel nearly works.

Ecore generation is clean. (too clean the static EAnnotations are missing.)

xxxTables has the extra feature support.

Parsing against the *.ecore works.

But parsing against the loaded EPackage fails - missing static declarations.

Parsing against the loaded xxxTables fails since the xxxTables is incomplete - no feature containment.


Short of improving Ecore, the only option is to have an Ecore load helper with xxxTables the natural location fpr that help.

However OCL is a modeling language so surely it should be parsed against the model? Maybe it is just bad JUnit test coding that is creating a non-problem.

eclipse-ocl-bot commented 4 days ago

By Ed Willink on May 04, 2022 09:26

(In reply to Ed Willink from comment #1)

However OCL is a modeling language so surely it should be parsed against the model? Maybe it is just bad JUnit test coding that is creating a non-problem.

Parsed against the model or, more precisely, aginst the Pivot representation of the parsed model.

OCLmetamodel/OCLstdlib provide the naive Pivot AS serialization.

PivotTables/OCLstdlibTables provide the added value AS literals and inheritance.

Why do we have both? Seems like we should merge the serialization to make the Tables complete.

eclipse-ocl-bot commented 4 days ago

Nov 09, 2022 08:17

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

eclipse-ocl-bot commented 4 days ago

By Ed Willink on Feb 17, 2023 01:54

(In reply to Ed Willink from comment #2)

Why do we have both? Seems like we should merge the serialization to make the Tables complete.

Rationalization moved to Bug 581543.