Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Why save all resources in DAnalysisSession
Why save all resources in DAnalysisSession [message #1790079] Mon, 04 June 2018 12:54 Go to next message
mind calm is currently offline mind calmFriend
Messages: 52
Registered: July 2017
Member
Hi,

I'm analyzing sirius models saving performance. In my test scenario, i have a model with many representations, i extract each representation to a separated .aird file, then analyze the saving process.
I found that when i edit in a diagram, than save it, the system will save all aird files in the same session.
When i analyze the source codes, i found in DAnalysisSessionImpl.doSave() function, it add all session resources, semantic resources and controlled resources to a set, then get a saving policy (IsModifiedSavingPolicy) to save these resources. In IsModifiedSavingPolicy, it compute which resource need to do save, in its filter, it get resources which has been logically modified, and get resources which references to the logically modified resources.

For example, resource A is logically modified, resource B and C are not changed, but B and C reference to A, so it save all A, B and C.

Is there any reason to save B and C? I want to comment out save B and C, but i'm afraid it bring some mistakes.


Best regards!

by Keep Mind Calm
Re: Why save all resources in DAnalysisSession [message #1790082 is a reply to message #1790079] Mon, 04 June 2018 13:25 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6040
Registered: July 2009
Senior Member
Hi

The problem is the stability of xmi:id references. The default EMF policy is to avoid wasting space on xmi:id definitions at the expense of longer xmi:idref positional values that obviously vary if the content changes. Therefore all referring models must be saved if the referred model changes. If not, look forward to the excitements if unresolved proxies.

You may use custom EMF Resources that implement your own xmi:id policy. NB just generating explicit xmi:id values won't help since the values may still change, particularly if using UUIDs.

A solution which may be applicable is to generate semantically stable xmi:ids so that they do not change as surrounding context changes. If you really want to go down this approach look at the OCL LUSSID (Locally Unique Sementically Sensitive IDentifier) in GIT\org.eclipse.ocl\plugins\org.eclipse.ocl.pivot\src\org\eclipse\ocl\pivot\internal\resource\LUSSIDs.java.

Regards

Ed Willink

Re: Why save all resources in DAnalysisSession [message #1790128 is a reply to message #1790082] Tue, 05 June 2018 14:44 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 161
Registered: June 2017
Senior Member
Hi Ed,

The scenario we had in mind and that may not be true anymore is the following:

- We have resources using xpath to reference its object and not ids.
- We have a model A referencing an element E in a model B in a multi EReference.
- In a diagram editor we reorder E before another element with the properties view.
- It seems at some point that the change did not flag A as modified so the save would ignore it causing problems to the next opening.

Do you see any misunderstanding?

Regards



Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Why save all resources in DAnalysisSession [message #1790132 is a reply to message #1790128] Tue, 05 June 2018 16:01 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6040
Registered: July 2009
Senior Member
Hi

If you are using Xpath then my comments may be totally irrelevant. But since this is the Sirius newsgroup and AFAIAA Sirius exploits EMF, which has no support for Xpath, I would expect normal EMF policies to apply to saving,.

While you might use Xpath for some references, are you sure that EMF references are not used for others.

Either way if you are saving Resources from a ResourceSet, EMF can save them all to memory, compare with the file system and only actually write those that are changed.

Regards

Ed Willink
Previous Topic:Get GMF Node from DNodeSpec
Next Topic:Disable vertical scroll bar container
Goto Forum:
  


Current Time: Sat Sep 22 17:18:22 GMT 2018

Powered by FUDForum. Page generated in 0.02198 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top