Bug 496532 - Allows for the override of the refresh implementation
Summary: Allows for the override of the refresh implementation
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 4.1.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2016-06-22 05:04 EDT by Cedric Brun CLA
Modified: 2016-10-18 11:08 EDT (History)
4 users (show)

See Also:


Attachments
Simple override preventing any refresh to happen (7.81 KB, application/zip)
2016-06-27 09:13 EDT, Cedric Brun CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2016-06-22 05:04:49 EDT
During EclipseCon France Akos demonstrated an experimental refresh algorithm which was fully incremental thanks to VIATRA's capabilities.

Making the refresh algorithm swappable at the Sirius level would ease such initiatives/experiments and could even, in fairly extreme use cases be usefull to get more performances with an implementation specificaly tuned to a specific diagram.

As of now we already have an API which is quite close to that:
org.eclipse.sirius.diagram.business.api.refresh.IRefreshExtension with 

void beforeRefresh(DDiagram dDiagram);
void postRefresh(DDiagram dDiagram);

methods. I'd like to extend it to have an:

 boolean aroundRefresh(DDiagram dDiagram);

method (through a specific interface in order to keep the API compatible). If an implementer returns true then Sirius don't do its own refresh.

The open question is what happens when several extensions are provided for a given diagram.  I see two alternatives:

a°) Sirius calls every one and if at least one returned true it won't trigger its refresh
b°) Sirius calls each one and stops as soon as one returns true: this looks randome to me as the extension point don't have any kind of ordinal/priority mechanism.

Considering that it's a case which is unlikely to happen anyway I would go for a°), any opinion against?
Comment 1 Eclipse Genie CLA 2016-06-22 05:41:21 EDT
New Gerrit change created: https://git.eclipse.org/r/75699
Comment 2 Istvan Rath CLA 2016-06-22 13:09:26 EDT
I agree that option a) is better.
Comment 3 Istvan Rath CLA 2016-06-22 15:30:42 EDT
Btw. many thanks for doing this!
Comment 4 Laurent Fasani CLA 2016-06-27 08:55:04 EDT
You could provide a scenario providing a plugin containing just your extension with a refresh that do nothing and return true.
The scenario would be to state that nothing is done during refresh for example.
Comment 5 Cedric Brun CLA 2016-06-27 09:13:27 EDT
Created attachment 262716 [details]
Simple override preventing any refresh to happen
Comment 7 Cedric Brun CLA 2016-08-02 09:25:41 EDT
Looks like we are done here. This will be available with Sirius 4.1
Comment 8 Julien Dupont CLA 2016-09-09 04:48:08 EDT
Technical issue
Comment 9 Pierre-Charles David CLA 2016-10-18 11:08:28 EDT
Available in Sirius 4.1.0, see https://wiki.eclipse.org/Sirius/4.1.0 for details.