Developer Guidelines

To avoid performance issues, some guidelines must be followed.

1. Viewpoint Generation

It is recommended to generate viewpoint with CDO Native.

Please refer to the Capella Studio Documentation to see how to generate this part of the Viewpoint.

2. CDO Native Vs CDO Legacy mode

Viewpoints (as described in Capella Guide > User Manual > Overview > Capella Ecosystem) must be generated for CDO.

Nevertheless, if you decide to use the Legacy mode, you can enable it by setting the non-UI preference CDOSiriusPreferenceKeys.PREF_SUPPORT_LEGACY_MODE to true, even it is not a recommended nor supported mode in Team for Capella. For more information, refer to the Activate Legacy mode support.

3. Diagram extensions

3.1. Mapping accesses

Repeated calls to the following methods must be avoided:

  • org.eclipse.sirius.viewpoint.DRepresentationElement.getMapping() and concrete equivalents: org.eclipse.sirius.diagram.DDiagramElement.getDiagramElementMapping() and getActualMapping(), org.eclipse.sirius.table.metamodel.table.DTableElement.getTableElementMapping(), org.eclipse.sirius.tree.DTreeElement.getTreeElementMapping()

  • org.eclipse.sirius.viewpoint.Style.getDescription()

  • org.eclipse.sirius.diagram.DDiagram.getDescription(), org.eclipse.sirius.table.metamodel.table.DTable.getDescription() and org.eclipse.sirius.tree.DTree.getDescription()

For remote models, these methods do not simply access to a reference as the target objects are not shared, then it is recommended to use local variable instead of multiple occurrences of those calls.

3.2. Interpreter access

Repeated calls to org.eclipse.sirius.tools.api.interpreter.InterpreterRegistry.getInterpreter(object) must be avoided. Note that the IInterpreter is the same for the whole ResourceSet and corresponding Sirius Session. If you already have this Session, you can use org.eclipse.sirius.business.api.session.Session.getInterpreter().