Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Computing the transitive hull of dependant resources
Computing the transitive hull of dependant resources [message #720802] Wed, 31 August 2011 09:17 Go to next message
fadjmpFriend
Messages: 6
Registered: August 2011
Junior Member
Hi,

I need help to deal with the following problem. In the language I develop, modifying a resource x can lead to affect another resource y (which has thus to be re-build) even if the EObjectDescriptions of x are unchanged.

I use my own isAffected functions (by overriding the ones of resource.impl.DefaultResourceDescriptionManager). The problem is that isAffected is not called by builder.clustering.ClusteringBuilderState.doUpdate when the EObjectDescriptions of the modified resource are unchanged. Thus, isAffected doesn't have the opportunity to reply that the resource y is affected by the modification of x (if it is the case).

I see 2 bad solutions:
1. Putting in the description of the resource an EObjectDescription containing a hash of the content of the resource. This EObjectDescription will change as soon as the resource changes, so isAffected will be always called by doUpdate. This solution seems very unefficient.
2. Overriding doUpdate to always call isAffected. I don't like this solution because it implies copying and pasting this complex method of more than 100 lines, to change only one argument in a method call (i.e. to use the variable newDeltas instead of changedDeltas in the last call to queueAffectedResources).

Does someone has an idea on how to solve my problem ?

Thank you very much in advance,
Florence
Re: Computing the transitive hull of dependant resources [message #720819 is a reply to message #720802] Wed, 31 August 2011 09:53 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

you could modify the creation of the EObjectDescriptions adding user data representing information that is relevant for actual semantic change.
A first approximation is indeed the hash serialised form of the object, but the algorithm may be smarter (count children, whatever).

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Computing the transitive hull of dependant resources [message #720833 is a reply to message #720819] Wed, 31 August 2011 10:18 Go to previous messageGo to next message
fadjmpFriend
Messages: 6
Registered: August 2011
Junior Member
Thank you for this answer. Let me make precise my problem : as soon as the first file is modified and whatever the modification is, I want the second file to be rebuilt (if the first file is imported with a particular keyword). Thus, the only information that i need is that the first file has been modified. This info is available in doUpdate, so I think it is a pity to be abble to compute and store hashes of all objects in order to pass the test (in doUpdate) that decides to do nothing if the EObjectDescriptions remain the same.

My "special import" can seem weird to you, but it is simply a way to say "behave exactly as if the first file was written at the beginning of the second file"

Florence
Re: Computing the transitive hull of dependant resources [message #720841 is a reply to message #720833] Wed, 31 August 2011 10:40 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

the Xtext framework's notion of the modification of a referenced file *is* that the XDescription change. So either you adapt the user data of the EObject description (using a timestamp should be faster than calculating the hash of the content) or you use your alternative 2.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Computing the transitive hull of dependant resources [message #720845 is a reply to message #720841] Wed, 31 August 2011 10:48 Go to previous message
fadjmpFriend
Messages: 6
Registered: August 2011
Junior Member
Ok, thank you very much, I will choose between one of these solutions.

Florence
Previous Topic:root model imports
Next Topic:Custom end-of-line character, w/ default value.
Goto Forum:
  


Current Time: Sat Apr 20 00:38:30 GMT 2024

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

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

Back to the top