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

Add indirection in View API to allow view type to transform view changes #578

Merged
merged 5 commits into from
Jan 18, 2023

Conversation

JanWittler
Copy link
Contributor

@JanWittler JanWittler commented Dec 30, 2022

This PR provides two contributions:

  • Instead of allowing a view to directly commit to the underlying model, an indirection over the view type is introduced. When creating a view with a non-identity mapping, this function encapsulates the necessary backwards transformation from changes corresponding to instances of the view metamodel to changes corresponding to instances of the underlying model metamodel.
    • As a side effect, the propagated changes are not exposed anymore to the view.
    • Currently, we only have the IdentityMappingViewType which does not need to transform changes. However, with the migration to UUIDs this API refinement also allows to use hierarchical IDs in the view and assign UUIDs in the view type, thus completely hiding the UUIDs from the view.
  • Refines the StateBasedChangeResolutionStrategy to return unresolved changes. This was changed as previously the elements of the internal intermediate ResourceSet were exposed.

TODOs

  • create tests for IdentityMappingViewType:commitViewChanges

@JanWittler JanWittler requested a review from a team December 30, 2022 15:44
@JanWittler JanWittler requested a review from TomWerm as a code owner December 30, 2022 15:44
@JanWittler JanWittler force-pushed the view-change-transformation branch from 3217e52 to 8967ef3 Compare January 9, 2023 09:36
@JanWittler JanWittler force-pushed the view-change-transformation branch from 42b7f9c to 8e8859f Compare January 17, 2023 13:13
@JanWittler JanWittler merged commit 9995d64 into main Jan 18, 2023
@JanWittler JanWittler deleted the view-change-transformation branch January 18, 2023 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants