Community
Participate
Working Groups
Created attachment 262082 [details] Aird - phase 2 This is the phase 2 of Bug 493353 - Representation persistence improvements. Phase 1 has be done in Bug 493367. The idea of this second phase is to reorganise the aird content in order to remove the DRepresentation from the DView in favor of the DRepresentationDescriptor introduced in phase 1, ie. the DRepresentation and their graphical data (GMF model, ComputedStyleDescriptionRegistry, ..) will be stored in the DAnalysisCustomData or as additional roots of the aird. A DRepresentation will no more have its DAnalysis in its ancestor : several queries, helper and way to retrieve the session, the aird, the Danalysis will have to be modified. The serialization order changes will require a specific ExtendedMetaData put on aird resource. We currently set one for migration purpose when required. We will need to look at: . org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.Lookup.listFeatures(EClass) . org.eclipse.emf.ecore.util.ExtendedMetaData.getAllElements(EClass) and maybe provide our own specific "aird" ExtendedMetaData (do not forget that we already have one in case of detected migration needs). Without this, the feature order follows the inheritance tree and the declaration order of the structural features but we might want to mix this: description of DRepresentation is not declared on the DRepresentationEClass but on each concrete representation class but for human readability and parsing speed, it would be great to serialize it before the content of a representation and not at the end of it. We also would like at the end of this phase an experimental mode to put the representations in their own files. This will require: . the introduction of a "repPath" attribute on the DRepresentationDescriptor with the corresponding new datatype if required . the modification of DRepresentationDescriptor#representation to become derived|transient (volatile|changeable values will be decided later ) . a migration to move the DRepresentations at the end of the file and to support the repPath and derived representation reference. . a "repFile" resource implementation with load instrumentation and migration capabilities (see aird and odesign resources). . modification of the migration/repair action . impact analysis of the load with first improvements of the ux. . a specification of the DRepresentationDescriptor "from aird vs from repfile" synchronization.
Created attachment 262083 [details] Aird - phase 2 experimental mode
For the Phase 2 and to allow the experimental implementation of the one resource per representation mode, the metamodel will need several modifications. The goal is to be able to delay the load of the graphical data, ie. DRepresentation: . representationPath: a new datatype is required to store the URI of the representation (see work done in Bug 456351 in which models links have been replaced by semantic resources datatype on DAnalysis). . representation:DRepresentation [0..1] derived|transient|volatile|nonChangeable – reference to the representation . will be computed/set during load/opening of the DRepresentation . might trigger the repfile load . we might decide to use eIsSet or null value to know that the representation has not been loaded . changeable or not || volatile or not: might change after discussion with team on how/where to reference the concrete representation (see next section) . The migration will be updated to handle the changes done here. We have several options to manage the DRepresentationDescriptor in the repfile: . we might create an abstract DRepDescriptor class and two concrete subclasses: one for the aird, the second for the repfile with different implementation of the path/representation features. . it is not clear yet if the DRepresentationDescriptor of the repfile really needs to be serialized as it can be computed during load but also parsing or directly computed from the DRepresentation when needed for comparison, checks or update of the DRepresentationDescriptor from the .aird file. Depending on this choice, we might need a root container in the new file. . Representation might inherit from DRepresentationDescriptor: this does not look safe This will have to be discussed in phase 2 to choose the final implementation to do in phase 3.
Implementation of the links/references between a DRepresentation and its DRepresentationDescriptor(s) A specific adapter could be used to manage the load/sync. It will be created on each DRepresentationDescriptor loaded from the aird and will also be added to its eAdapters list. It might be used to store the loaded representation, the DRepresentationDescriptor#representation can then be volatile and non changeable. It will be used to synchronize the changes done on the representations or on its descriptor(s). The synchronization mechanism will be detailed later, but it needs to avoid reentrant calls and the amount of notification must be minimized. It might also be the support of the synchronization for the permissions on the representation and/or its descriptor (IPermissionAuthority / locks).
User Interface Changes - Phase 2 . transparent changes for use: editor input, saveable, open from markers, eclipse restart with opened editors . No UI to activate/deactivate the 'one file per representation experimental mode' . Experimental Content provider / file management choice . hidden folder/file, name pattern, file extension will have to be specified in this phase. . experimental mode: several scenario/choices could be evaluated (might need to sync with Capella, ...)
Notes: During poc implementation (auto-control of the contained representations), I used the following file pattern . representations.aird (default name will have to be changed) . .representation_aird . Neon forbids to save representation.aird folder if a file with the same name exists, I had no issues with Mars . we must not forget that the file systems of the targeted system (Windows, Linux, Mac) might have different capabilities. . .representation_aird/xxxxxxxxxxx.repfiles where xxxxxxxxxxx is the uriFragment of the representation before control.
Tests and Non-regression strategy - Phase 2 . Existing tests will be adapted for this phase (see UI changes for a list regressions to avoid) . Migration test: serialization changes, DRepresentation moves . Experimental mode can be tested through local tests after improvements and adaptation of the poc test patch sets.
New Gerrit change created: https://git.eclipse.org/r/74795
New Gerrit change created: https://git.eclipse.org/r/74797
New Gerrit change created: https://git.eclipse.org/r/74796
New Gerrit change created: https://git.eclipse.org/r/74994
New Gerrit change created: https://git.eclipse.org/r/74993
New Gerrit change created: https://git.eclipse.org/r/75447
New Gerrit change created: https://git.eclipse.org/r/78767
New Gerrit change created: https://git.eclipse.org/r/79193
New Gerrit change created: https://git.eclipse.org/r/79422
New Gerrit change created: https://git.eclipse.org/r/79634
Gerrit change https://git.eclipse.org/r/79193 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=d3bd4e4cd3380667e1f8cf53db9036f386fa65f5
Gerrit change https://git.eclipse.org/r/75256 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=2ec3f603341100ccf85f4202e8eddad07c4ebe03
Gerrit change https://git.eclipse.org/r/79634 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=43c3706635f9f396a881650d94c01589782149d8
Gerrit change https://git.eclipse.org/r/75379 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=0f209993da868e0d6d945d10b159bb04b01a6869
Gerrit change https://git.eclipse.org/r/75447 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=fd1b762d83b72366e42d1e78c2e00bbaec02b109
Gerrit change https://git.eclipse.org/r/75477 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=c72eeb7a8a8bdb86ddca6670ff7a420d5c92a7c9
Gerrit change https://git.eclipse.org/r/78767 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=331e109502dd7afc783b75b32917e533f5b43b20
Gerrit change https://git.eclipse.org/r/74797 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=b84de07ef47a88d5f3967bab264fafe3d910aa29
Gerrit change https://git.eclipse.org/r/74796 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=d5c5857164f34988e010ae96b3f828e6b103aa71
Gerrit change https://git.eclipse.org/r/74993 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=12202519bee77e5816e364b89809edd788b0660d
Gerrit change https://git.eclipse.org/r/74994 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=e52f35a5e28a64f0504b5a49877a2de8999d5119
Gerrit change https://git.eclipse.org/r/75255 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=c4e02132c9cdb6fe0816c93c3bb19d2a1c27b4bd
Gerrit change https://git.eclipse.org/r/75339 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=025db433225a4f58051a055fdfa13e0c3d11072b
To sum up, the commits related to this ticket are about the second step to save the DRepresentation in its own resource. @org.eclipse.sirius.viewpoint.DView.getOwnedRepresentations()@ has been removed. The @DRepresentation@ is now created as root element of the representations resource. The main impact is on the core of Sirius but also potentially on client Sirius customization. Each peace of code that makes the supposition that the @DView@ is the container of the @DRepresentation@ must be reworked. The code using methods in the following list may be concerned by the rework: ** @EObject.eContainer()@. If the object is a @DRepresentation@, its container is now null. ** @EcoreUtil.getRootContainer(xxx)@. The root container of a DDiagramElement is the @DRepresentation@ and not the @DAnalysis@ any more. ** @EcoreUtil.isAncestor(xxx)@. the @DView@ is not an ancestor of a @DRepresentation@ (or its content) anymore. As a developer, the followings utility methods will help you to migrate your code following the second step described above: ** @org.eclipse.sirius.business.api.query.DViewQuery.getLoadedRepresentations()@ replaces the removed @DView.getOwnedRepresentations()@ method. It provides all the loaded representations holds by a @DView@. In this step, all that representations are always loaded as they are into the .aird resource. ** @org.eclipse.sirius.business.api.query.DViewQuery.getAllContentInRepresentations(final Predicate<? super EObject>)@ provides the content of a @DView@ according to a predicate. ** @org.eclipse.sirius.business.api.query.DRepresentationQuery.getRepresentationDescriptor()@ provides the @DRepresentationDescriptor@ which references the @DRepresentation@. ** @org.eclipse.sirius.business.api.query.EObjectQuery.getDAnalysis()@ allows to retrieve a DAnalysis from a @DRepresentationElement@
New Gerrit change created: https://git.eclipse.org/r/79815
Gerrit change https://git.eclipse.org/r/79815 was merged to [master]. Commit: http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/commit/?id=da2b4f6b4f3e24977d8880416839e3e98121e86b
Technical issue
Available in Sirius 4.1.0, see https://wiki.eclipse.org/Sirius/4.1.0 for details.