The judgement of DDiagramElementSynchronizer.isSameDescription() [message #1784680] |
Mon, 02 April 2018 08:38  |
jingjing wang Messages: 28 Registered: July 2017 |
Junior Member |
|
|
private boolean isSameDescription(StyleDescription bestStyleDescription, Style style, Style bestStyle) {
return bestStyleDescription == style.getDescription() && bestStyle.eClass().equals(style.eClass());
}
About this function, we think that maybe the judgement of bestStyle.eClass().equals(style.eClass()) is redundant. If the StyleDescription is same, the class of the Style is also same. So why Sirius needs to judge the class of Style?
In our analysis, if deleting the jugement of Style'class, the performance of style refresh maybe improved. About the DDiagramElementSynchronizer.refreshStyle(), when the StyleDescription is same, there is no need to invoke mappingHelper.getBestStyle() which will create a new Style and update the Style according to StyleDescription.
We hope anyone can give us some advise or explaination about this problem.
Thanks!
[Updated on: Mon, 02 April 2018 08:39] Report message to a moderator
|
|
|
Re: The judgement of DDiagramElementSynchronizer.isSameDescription() [message #1784941 is a reply to message #1784680] |
Fri, 06 April 2018 07:42  |
|
This code has not changed for a long time, so my memory is a little fuzzy, but from what I remember the test is actually needed to handle cases where style customizations are applied. This may not be the case in your own modeler, but there are several mechanisms (conditional styles, style customizations, mapping imports which override the default style, etc.) where the relationship between a Style instance and StyleDescription are more complex than they look at first glance, and this test is needed to handle those.
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03102 seconds