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

Deresolve uses TokenResolvers instead of ReferenceResolvers, when saving an model with eProxies to textual format #29

Open
rolftheunissen opened this issue Jun 5, 2013 · 3 comments

Comments

@rolftheunissen
Copy link

To save an excising model in xmi format in a concrete textual format, the xmi file can be open with the sample reflective model editor. Then it can be saved as a file in textual format by saving it using 'Save as ...' with the corresponding extension.

The xmi file may contain references to other files. If these eProxies are resolved before saving, the serialization is correct.
If the eProxies are not resolved before saving the model, TokenResolvers are used to deresolve the references instead of ReferenceResolvers.

If the model contains unresolved proxies, these proxies should be resolved before saving the model.

To reproduce:

  1. Load an xmi file with references to other files, with the sample reflective model editor.
  2. Save file directly without exploring or validating the model to a textual file.
@mirkoseifert
Copy link
Member

I'm not sure how to handle this. You're probably suggesting that the generated resource class should resolve all proxies right before it is saved. Howerer, I'm not sure whether this is a good default behavior. I distinctly remember that there were cases where we explicitly rely on the fact the proxies are not resolved before saving (e.g. in JaMoPP). Is there another way to fix this?

@jjohannes What's your opinion?

@jjohannes
Copy link
Contributor

I think the problem described here is another one. Usually, references are resolved automatically when the model is serialized at the latest.

In JaMoPP, which Mirko was referring to, we have a specialized implementation that does not resolve proxies during printing, because this can be very expensive.
(see: https://github.com/DevBoost/JaMoPP/blob/master/Core/org.emftext.language.java.resource/src/org/emftext/language/java/resource/JavaSourceOrClassFileResource.java#L178)

I think the issue is something different. @rolftheunissen: Could you post an example to reproduce the problem?

@rolftheunissen
Copy link
Author

I am trying to reproduce the problem in a small example. So far the problem does not occur when the type of the referenced items is defined in the same metamodel. I can see in the editor that the other resource is loaded while saving the model.

The problem does occur in our real models where the type of the elements that are referred is defined in another metamodel. I will try to construct an example later.

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

No branches or pull requests

3 participants