Community
Participate
Working Groups
Some Sirius API users use "UserSession.selectViewpoints()" to select some viewpoints at session init. . But in some case it leads to deadlock between UI thread on UI resource and our use of CDO framework with synchronized lock on CDO resources. Then "UserSession.selectViewpoints()" should be deprecated in flavor of an non UI API to select and unselect Viewpoint. Finally this class should be deprecated entirely because all others methods are already available in Sirius API. Sirius API needs a non UI class to do the Viewpoint selection/unselection and a EMF Command to do that also. For example with : interface Session { ... selectViewpoint(String viewpointName); unselectViewpoint(String viewpointName); ... } and EMF Commands : class SelectViewpoints extends RecordingCommand { SelectViewpoints(Session, Collection<String> viewpointNames); } class UnselectViewpoints extends RecordingCommand { UnselectViewpoints(Session, Collection<String> viewpointNames); } NOTE: with Viewpoints selection in Session interface we could remove Session methods like Session.addSelectedView()/removeSelectedView()/createView() which are Viewpoints selection/unselection specific and are not/must not be used by Sirius API users.
I'm not a fan of the whole UserSession API. It was initially created by an external user to work around the complexities of using our standard APIs. The correct way would have been to fix our own APIs instead of trying to paper over it, so +1 to take this opportunity to get a proper (non-UI) API for Viewpoint de/selection. However, -1 to use viewpoint names as identifiers. It was a bad idea in the original (the name is not globally unique) and we should not reproduce it. org.eclipse.sirius.business.internal.movida.ViewpointSelection was an attempt at a better solution, with consistency checks and proper identification of Viewpoints, but it was never finished/enabled. Not sure how much of it can be reused (even if just as inspiration).
A first release of patch has been submitted to Gerrit : https://git.eclipse.org/r/21509 : Deprecate some class about Viewpoint selection/unselection in flavor of Session.selectViewpoint(URI)/unselectViewpoint(URI) - SelectViewpointCommand/UnselectViewpointCommand replace ChangeViewpointSelectionCommand which become deprecated - ViewpointSelection.Callback and all implementations are now deprecated to have Viewpoint selection independant of UI at compilation and execution and because a callback here is useless - deprecate some SiriusResourceHelper methods en flavor of Session.selectViewpoint()/unselectViewpoint() - deprecate all Session methods about DView in flavor of Session.selectViewpoint()/unselectViewpoint() RAF: - have all Sirius code use Session.selectViewpoint()/unselectViewpoint() instead of deprecated code - update the release notes/api changes