Bug 432400 - Remove DRefreshable (or at least DRefreshable.refresh and associated code)
Summary: Remove DRefreshable (or at least DRefreshable.refresh and associated code)
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 1.0.0M6   Edit
Hardware: All All
: P2 enhancement (vote)
Target Milestone: 6.0.0   Edit
Assignee: Pierre-Charles David CLA
QA Contact: Guillaume Coutable CLA
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks: 427247
  Show dependency tree
 
Reported: 2014-04-09 04:53 EDT by Pierre-Charles David CLA
Modified: 2018-06-27 11:55 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Charles David CLA 2014-04-09 04:53:01 EDT
The DRefreshable type, defined in viewpoint.ecore, provides a single refresh() method. It is implemented by DView, all concrete DRepresentation and DRepresentationElement classes, and a lot of code seems to exist solely to support the implementation if these refresh methods.

The problem is that this implementation seems completely parallel to the main refresh algorithms (for example DDiagramSynchronizer), and I doubt it correctly implements all the subtleties needed for a correct refresh (handling of mapping imports and reuses, representation extensions, layers, conditional styles, style feature customizations, etc. etc.).

From what I could  gather, all this mechanics only exists for historical reasons, when the refresh/synchronization logic was spread over all the representation elements types instead of centralized in the D*Synrchronizer classes. It had the nice property of supporting partial refresh on only a sub-set of a representation, but at this point it has not been actively maintained for years, and it's not clear if it works, or even if it is ever called in normal operation.

More concrete details:
* When called on a DRepresentation, DRefreshable.refresh() actually delegates to DialectManager.refresh(), so this case is fine, although redundant.
* When called on a DRepresentationContainer, it refreshes all its valid representations (see the point above), and also removes all the ones with no/invalid target. That may be a valid operation, but it could be implemented without exposing an API in the metamodel.
* For all the concrete DRepresentationElement types, each has its own refresh logic, which in most cases look like a simplified (and thus probably broken) version of what the global D*Synchronizers do.

Further investigation is needed (hence this ticket), but it looks like quite a lot of code could be removed and/or simplified if indeed we can remove DRefreshabe.refresh().
Comment 1 Pierre-Charles David CLA 2014-08-14 04:29:30 EDT
I have a local commits which perform part of this cleanup, but they are not finished and need to be rebased on the current master (or more probably on master after we have switched to EMF 2.10 for the generation). The rebase itself will not be trivial given the amount of changes, so I'm not sure at all this will be ready for 2.0. I'll try make the changes incremental so that at least part of it can be in 2.0 even if all is not finished.
Comment 2 Pierre-Charles David CLA 2015-06-23 10:36:03 EDT
Moving to 4.0 as we do not want to break APIs for 3.1, especially for something like this, which is "just" a cleanup.
Comment 3 Pierre-Charles David CLA 2015-12-15 04:11:38 EST
Moving out of the 4.0 scope for now, along with all the other issues which were there "by default". This does not mean some of these will not be re-integrated at some point, but for now these issues are not part of the roadmap for 4.0.

If you feel strongly about this removal from 4.0 and/or are ready to sponsor the corresponding work, feel free to comment.
Comment 4 Pierre-Charles David CLA 2017-09-27 05:15:00 EDT
Adding to 6.0, but at a very low priority. I have a very old branch where I started work in this, if I can find the time I'll try to rebase it and finish the work.
Comment 5 Pierre-Charles David CLA 2018-03-27 04:49:12 EDT
Increasing priority: this is actually important for bugs #531396 and #531282. The DRefresable.refresh() implementations have dependencies to quite a lot of non-MM code (Session, SessionManager, DialectManager, several *Query, etc.) and are the sole reason for several *Spec classes to exist (which could thus be removed without this code).
Comment 6 Eclipse Genie CLA 2018-04-19 08:46:23 EDT
New Gerrit change created: https://git.eclipse.org/r/121411
Comment 8 Pierre-Charles David CLA 2018-04-23 11:14:08 EDT
Fixed by bf951b4a94361d0fb2117a8474dca30df49b6aea. Note that there is nothing particular to test/validate, this is an internal change which should not have any visible impact.
Comment 9 Guillaume Coutable CLA 2018-05-25 04:16:43 EDT
Technical issue
Comment 10 Laurent Redor CLA 2018-06-27 11:55:43 EDT
Available in Sirius 6.0.0, see https://wiki.eclipse.org/Sirius/6.0.0 for details