[EMF Compare] Is there any way to tweak matching phase? [message #1702482] |
Wed, 22 July 2015 11:51  |
Eclipse User |
|
|
|
Dear all,
Could anybody suggest me a way to configure Matching Engine in the EMF Compare, so that during he matching phase I can change the behavior of the matcher for specific EObject elements. The problem is when I am using objects of classes that don't have id attributes and there is at least 3 objects, that have types with the same super-type. It might be even the case that two compared files with models are exactly the same, still EMF Compare will calculate some differences. So the only option is to change somehow the matching procedure. As it was already discussed on https://www.eclipse.org/forums/index.php/t/1049514/, equality helper is not used during the matching phase. So the question is: Is there any other possibility to change the matching logic without reimplementing it from the scratch?
For example if I am comparing two elements of type A they are matched if they have same size or any other logic specific to this concrete types.
Thank you in advance for the answer!
Best regards,
Richard
|
|
|
Re: [EMF Compare] Is there any way to tweak matching phase? [message #1702568 is a reply to message #1702482] |
Thu, 23 July 2015 05:55  |
Eclipse User |
|
|
|
Hi Richard,
We are matching elements mainly through their id. If you have any way to compute one for the elements that are not properly matched in your case, you might want to look towards defining customidentifiers for EMF Compare's use.
Otherwise, we fall back to a similarity-bassed matching, and it seems this similarity doesn't do the trick in your case to properly match your elements together.
You could insert your own implementation of an IEObjectMatcher in between the identifier and similarity ones, in order to match these particular elements your own way while leaving the usual matchers do the work for you in all other cases. If you look at the sample code I've linked just above, you'll see that it uses a "idMatcher" and "fallbackMatcher". You could use the same kind of strategy to insert your own in between.
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.06167 seconds