Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 482993

Summary: Provide an improved "model query" API with no dependencies on Sirius
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: CoreAssignee: Pierre-Charles David <pierre-charles.david>
Status: CLOSED FIXED QA Contact: Maxime Porhel <maxime.porhel>
Severity: normal    
Priority: P3 CC: maxime.porhel, steve.monnier
Version: 3.0.0Keywords: triaged
Target Milestone: 4.0.0M7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/62801
https://git.eclipse.org/r/62800
https://git.eclipse.org/r/62803
https://git.eclipse.org/r/62802
https://git.eclipse.org/r/62807
https://git.eclipse.org/r/62806
https://git.eclipse.org/r/62805
https://git.eclipse.org/c/eef/org.eclipse.eef.git/commit/?id=eea19a2556d682ce50863d04826da8ac19eae25c
https://git.eclipse.org/c/eef/org.eclipse.eef.git/commit/?id=1477d393c2b609670833a55a1e6eb7f8781de104
https://git.eclipse.org/c/eef/org.eclipse.eef.git/commit/?id=b1115b6c4300c0b27bdb1acc7e084221dc60d73c
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=0d74a8b236315f68628a1ec3d3561cc9c593cbc3
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=c50cee2f411793d315416004cad8363ef5c8c3c0
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=7ed9d867900b8d42bacd2ee68be65788ea5e6056
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a6fe87cc952ed74af12bd659ea5d675027f7f85b
Whiteboard:

Description Pierre-Charles David CLA 2015-11-25 05:39:06 EST
For bug #482528 on properties view, part of the work (the actual views rendering) will be handled by code which resides in another project (EEF). That code will need to evaluate interpreted expressions defined in Sirius VSMs. We don't want to reproduce the existing Sirius APIs on the EEF side (and write and maintain all the dumb translation code between the two sides), and we can not make EEF depend on Sirius itself (which would cause a dependency loop).

A possible solution is to extract such an API from what exists already in Sirius in a separate plug-in (or plug-ins) that, while they live in the Sirius project, do not actually depend on the Sirius core.

This will be the opportunity to modify the existing Sirius API with long-needed improvements (e.g. in the area of variables management).

The current plan (open to discussion) is to provide:
* a new API defined in new Sirius plug-ins with minimal dependencies (ideally just EMF, maybe Guava; that was enough for the whole AQL implementation so it should be enough for us too).
* an implementation that translates the new API to the old one (IInterpreter);
* a way to obtain such a "wrapper implementation" from a Sirius session.

For bug #482528, this means the Sirius code which hands EEF the views description will also give it an implementation of the new API which is backed of by the existing Sirius interpreter (with all the languages supported there). EEF will only need to depend on the new API (not the wrapper implementation).

Separately from the work on #482528, we'll progressively rewrite all the Sirius code which uses the current/old IInterpreter API to use the new one instead, refining it in the process. Once this is done, we'll deprecate the old API, expose the new one, dropping the wrapper implementation for more direct ones (one for each supported language).

Given this plan, the goal of this new API is not only to break a dependency cycle with EEF, but also to fix/improve the problems with the existing API (cumbersome and error-prone variable management, inconsistencies between languages in coercion rules, lack of feedback on interpretation result, no support for query preperation/compilation...).

As mentioned above, this is what I have in mind right now, but almost all of it is open to dicsussion. The only immediate need is for EEF to be able to evaluate queries defined in Sirius VSMs without depending on the Sirius platform itself.
Comment 1 Eclipse Genie CLA 2015-12-16 05:10:12 EST
New Gerrit change created: https://git.eclipse.org/r/62801
Comment 2 Eclipse Genie CLA 2015-12-16 05:10:16 EST
New Gerrit change created: https://git.eclipse.org/r/62800
Comment 3 Eclipse Genie CLA 2015-12-16 05:10:17 EST
New Gerrit change created: https://git.eclipse.org/r/62803
Comment 4 Eclipse Genie CLA 2015-12-16 05:10:18 EST
New Gerrit change created: https://git.eclipse.org/r/62802
Comment 5 Eclipse Genie CLA 2015-12-16 05:10:30 EST
New Gerrit change created: https://git.eclipse.org/r/62807
Comment 6 Eclipse Genie CLA 2015-12-16 05:10:31 EST
New Gerrit change created: https://git.eclipse.org/r/62806
Comment 7 Eclipse Genie CLA 2015-12-16 05:10:32 EST
New Gerrit change created: https://git.eclipse.org/r/62805
Comment 15 Pierre-Charles David CLA 2016-05-08 09:34:29 EDT
I'm closing this as RESOLVED even though the current state is very far from the initial ambitions (which were probably too much and too vaguely defined anyway). We have a very narrow API that is enough for the EEF 1.6 runtime, which was the main motivation. It does not replace the current IInterpreter API used in Sirius itself though.

If we ever come back to this issue we'll focus on more specific steps, but this will probably have to wait until we have really abandonned the Query Legacy implementation, which will allow us to evolve the current API step-wise instead of going for a big-bang approach.
Comment 16 Maxime Porhel CLA 2016-05-23 10:57:29 EDT
Validated as technical issue on Sirius 4.0.0.201605180923 (4.0.0 RC1)
Comment 17 Pierre-Charles David CLA 2016-06-24 08:03:22 EDT
Available in Sirius 4.0.0.