Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose other containment-related derived values from the driver #7

Closed
agarciadom opened this issue Sep 26, 2022 · 3 comments
Closed
Labels
enhancement New feature or request priority:high High priority task

Comments

@agarciadom
Copy link
Member

In addition to eContainer (#5), EObjects also expose other special derived values, like eContainingFeature or eContents. Should we expose these as well?

@agarciadom agarciadom added priority:medium Medium priority task enhancement New feature or request priority:high High priority task and removed priority:medium Medium priority task labels Sep 26, 2022
@agarciadom
Copy link
Member Author

In today's discussion, we agreed that these would be useful.

I think that eContents should be a read-only list, however: this should be enforced by the driver.

@agarciadom
Copy link
Member Author

agarciadom commented Oct 9, 2022

eContainingFeature can be done if we overload the elementID property in the API to allow a uri#fragment syntax to refer to objects inside the registered EPackages.

eContents is actually a bit tricky: this is implemented by EMF as an EContentsEList whose contents are automatically derived from the object's containment references, which is great when we are using it from the JVM, but not for a stateless API: we would need to either keep the EContentsEList in the API (and then the API is no longer stateless), or we have to recompute the list on every access (and then the API would be very slow).

It looks like the best approach may be to simply return all the elements of eContents in one go, as a read-only list (not a proxy list) of element references. This would also avoid things like ConcurrentModificationExceptions if we are deleting elements at the same time that we traverse eContents.

agarciadom added a commit that referenced this issue Oct 9, 2022
This commit overloads the elementID message field to allow for a new
syntax ('uri#fragment'), where 'uri' is a metamodel URI in the package
registry, and 'fragment'  identifies an element within that package.

This is mostly to allow for simple implementation of
'.eContainingFeature', '.eClass' and so on, where we need to fetch
objects from the metamodel. Regular MDObjects will still use the
MagicDraw UUIDs.
agarciadom added a commit that referenced this issue Oct 9, 2022
@agarciadom
Copy link
Member Author

Implemented as of d4a53f2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:high High priority task
Projects
None yet
Development

No branches or pull requests

1 participant