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

Bug 456352

Summary: Remove support for "shared editing domain" mode
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: P1 CC: esteban.dugueperoux, laurent.redor, maxime.porhel
Version: 1.0.1Keywords: triaged
Target Milestone: 3.0.0M7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/43592
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=076925e0ca50be2f468de843307088a554cfe589
Whiteboard:
Bug Depends on:    
Bug Blocks: 456350    

Description Pierre-Charles David CLA 2014-12-30 10:07:49 EST
Currently Sirius supports a mode where several different Sessions share the same TransactionalEditingDomain and ResourceSet (this is triggered by setting DAnalysisSessionImpl.setDisposeEditingDomainOnClose(false)).

Supporting this means we can not simply consider all resources in the ResourceSet which are neither aird not VSMs to be semantic resources of the session. Instead we have to keep track of which resource is actually associated to this session (and not to another one sharing the editing domain). The maintenance of the corresponding DAnalysis.models reference is very costly compared to the alternative (the alternative being: "if its is not the main aird, an aird referenced by it, or a VSM referenced by an aird, it is a semantic resource").

The "shared editing mode" is relatively marginal and a somewhat hidden feature. The only client who actually used to use has siwtched to the "normal" mode, so it is time to remove support for it and leverage all the optimizations which become possible once this is done.

If possible at a reasonable cost, the "shared editing mode" should still be available as a deprecated mode in at least one major version of Sirius (e.g. 3.0), before we completely remove all the corresponding code from the codebase in the next version (e.g. 4.0).

Steps:
1. Devise a plan to keep the old session code as it is if possible, maybe under a different package, so that the "legacy" mode can still be used if really needed in Sirius 3.0, but we still can cleanup the main/default session implementation of all traces of it.
2. Simply remove direct support for setDisposeEditingDomainOnClose(false), and make sure everything keeps working fine (especially the tests).
3. Gradually replace all the costly mechanisms which were only needed to support this mode with simpler and more efficient ones. This may require the creation of sub-tickets for individual tasks.
Comment 1 Eclipse Genie CLA 2015-03-10 12:42:17 EDT
New Gerrit change created: https://git.eclipse.org/r/43592
Comment 2 Laurent Redor CLA 2015-03-12 13:37:10 EDT
For information, there is a potential code to impact in org.eclipse.sirius.tools.api.ui.RefreshEditorsPrecommitListener.getRefreshOpennedRepresentationsCommand(boolean): // Refresh only the editors of the current editing domain.
Comment 4 Pierre-Charles David CLA 2015-04-15 04:00:27 EDT
Fixed. Any cleanups and optimizations this change enables will be done in the context of other tickets.
Comment 5 Maxime Porhel CLA 2015-05-21 09:34:02 EDT
Validated on Sirius 3.0.0 RC1
Comment 6 Pierre-Charles David CLA 2015-06-24 11:13:59 EDT
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.