Open eclipse-ocl-bot opened 1 month ago
By Ed Willink on Sep 04, 2013 07:47
This solution is in the wrong place.
There is no justification for this idiom in the code generator; it is not the code generator's responsibility to repair inaccurate models.
The UML idiom should be realized in the UML model loader, so that a derived property body exists in the subsequent representation and downstream behaviour does not need to understand the idiomatic bad model.
Implementing the idiom in UML2Pivot will solve your problem once you move to UML models, but I'm afraid that your UML-to-Ecore process is broken.
The idiom is only useable for UML itself, so application of the idiom must be guarded by a check on the metamodel namespace. It is doubtful that 6.4.1 of UML 2.5 even extends to the UML XMI; 6.4.1 is concerned with how to read, not how to implement. So arguably the OMG UML XMI serializer is responsible for including the implied OCL bodies.
Beginning to look like WONTFIX. The solution is to mend the UML metamodel before use.
| --- | --- | | Bugzilla Link | 415389 | | Status | NEW | | Importance | P3 enhancement | | Reported | Aug 19, 2013 16:56 EDT | | Modified | Sep 04, 2013 07:47 EDT | | Version | 4.0.0 | | Reporter | Nicolas Rouquette |
Description
Created attachment 234554\ Proposed patch for supporting derived, read-only properties whose "getter" method should invoke a query operation with the same name as the property.
In the edw/414040 branch of MDT/OCL, the code generator for oclinecore does not fully handle the UML-like pattern for derived, read-only properties that must have a user-defined query operation of the same name. This pattern is extensively used in the definition of the OMG UML metamodel. For the oclinecore generator, I made a simple patch that supports this pattern.
:notepad_spiral: file_415389.txt