Open eclipse-uml2-bot opened 4 days ago
By Ed Willink on Sep 01, 2014 06:29
Created attachment 246587 Workaround
The attached workaround demonstrates that it is at least possible to use the Ecore Map idiom from UML as-is.
Note that both associations must exist to avoid a spurious java.util.Map$Entry Ecore class being created.
The associations can be unidirectional if the opposite ends are association-owned.
The workaround requires the Entry class to be explicitly modeled and the one Association to be partitioned in two.
The workaround also requires the OCL navigation
aBank[12345678]
to be expressed as
aBank.accountNo2persons->any(key = 12345678).value
unless OCL understands the idiom.
(Eclipse OCL needs to add this support for Ecore models anyway: Bug 443003).
It would be nice to have the compact UML exposition.
By Ed Willink on Sep 04, 2014 05:27
Discussion on Bug 443021 concluded that EMap is not sufficiently flexible and that an approach using EReference.eKeys may be better.
Bug 443195 contributes support for EReference.eKeys that may be useful for this UML enhancement request; it could support multiple qualifiers.
| --- | --- | | Bugzilla Link | 442744 | | Status | NEW | | Importance | P3 enhancement | | Reported | Aug 27, 2014 18:20 EDT | | Modified | Sep 04, 2014 05:27 EDT | | Depends on | 443195 | | Reporter | Ed Willink |
Description
Created attachment 246462\ UML 2.5 Fig 11.37
EMF supports mapped collections via a collection of intermediate java.util.Map$Entry.
Singly qualified associations could be mapped to this support. (Currently the qualifier is stripped by UML2Ecore without a diagnostic.)
Attached example could be supported.
Fig_11_37.uml