Bug 525263 - Provide a single, well-defined API for viewpoint querying and selection
Summary: Provide a single, well-defined API for viewpoint querying and selection
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 4.1.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: Next   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2017-09-27 05:58 EDT by Pierre-Charles David CLA
Modified: 2018-09-05 08:33 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 2017-09-27 05:58:42 EDT
We currently have several half-broken APIs for querying/selecting/deselecting viewpoints in a session. I count at least:
* org.eclipse.sirius.business.api.session.ViewpointSelector
* org.eclipse.sirius.business.internal.movida.ViewpointSelection (Movida-specific, so not actually used, but mentioned because the design tried to fix some of the issues of the existing APIs at the time, so maybe some ideas can be reused).
* org.eclipse.sirius.ui.tools.internal.viewpoint.ViewpointHelper (not API, but used internally).
* org.eclipse.sirius.ui.business.api.viewpoint.ViewpointSelectionCallback
* org.eclipse.sirius.ui.business.api.session.UserSession
* org.eclipse.sirius.ui.business.internal.commands.ChangeViewpointSelectionCommand
* org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.getSelectedViewpoints() and getSelectedViewpointsSpecificToGeneric()

I'm probably missing a few. Some of these call the others, some do their own things. I wouldn't be surprised if some code (our own or clients') directly manipulate DAnalysis.selectedViews.

The goal here is to have a single, well defined and well documented (and tested) API for querying/selecting/deselecting viewpoints in a session. It may be a completely new class or one of the already existing ones (maybe after some modifications). All the others should be either removed (if we're confident they're not used much in the wild), or @deprecated and rewritten to call the recommended API (instead of doing their own thing).