|Single-Side Match and location of ADD Diff [message #1189774]
||Sat, 16 November 2013 08:06
| Benjamin Klatt
Registered: September 2010
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
|Re: Single-Side Match and location of ADD Diff [message #1196080 is a reply to message #1189774]
||Tue, 19 November 2013 08:31
| Laurent Goubet
Registered: July 2009
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.
Powered by FUDForum
. Page generated in 0.01704 seconds