The judgement of DDiagramElementSynchronizer.isSameDescription() [message #1784680] |
Mon, 02 April 2018 04:38  |
Eclipse User |
|
|
|
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 04:39] by Moderator
|
|
|
Re: The judgement of DDiagramElementSynchronizer.isSameDescription() [message #1784941 is a reply to message #1784680] |
Fri, 06 April 2018 03:42  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.28113 seconds