Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Single-Side Match and location of ADD Diff(Where should the ADD diff describing a single side match be attached?)
Single-Side Match and location of ADD Diff [message #1189774] Sat, 16 November 2013 08:06 Go to next message
Benjamin Klatt is currently offline Benjamin KlattFriend
Messages: 36
Registered: September 2010
Member
Hi,

Assuming a two-way compare and a new element N in the left model contained in a parent element P.
P is present in the left and right model.

During the match phase:
I will create a match for P => machtP: match(left:P, right:P)
In addition, I will create a single-side match for N => matchN: match(left:N, right:<null>)

Durign the diff phase:
I will create a custom Diff for the new element => diff(changedElement: N, kind: ADD, source: LEFT)

So the question is: To which match to attach this Diff element?
Should I attach it to the sind-side match of the new model element "matchN",
or it's parent element's match "matchP" which has matched elements set for left and right.
Is there any best-practice / concept?

By the way: The same question applies to diffs of kind CHANGE. Any difference in that case?

Thanks a lot
Benjamin
Re: Single-Side Match and location of ADD Diff [message #1196080 is a reply to message #1189774] Tue, 19 November 2013 08:31 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Benjamin,

Which version of EMF Compare are you using? If using EMF Compare 2, differences are always attached to the Match of the element 'containing' the diff : if I change the value of the reference "ref" of the object "P" from "B" to "C", the diff is attached to "P" since it is the element which reference is modified. If I add a new child "N" to the object "P", the diff will also be attached to the match of "P" since the modified reference is one of P's.

In this example, "N" doesn't contain any difference of its own : it is a new element, true, but that element is attached to P; so the one that actually changed was P: it now contains a new child.

Laurent Goubet
Obeo
Previous Topic:Potential Bug in ProximityEObjectMatcher
Next Topic:Set equality helper
Goto Forum:
  


Current Time: Thu Apr 18 11:45:20 GMT 2024

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

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

Back to the top