[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.emft] Re: [EMF Compare] Similarity in ordered list

Hi Guillaume,

yup, that's exactly it. EMF Compare is based on a generic algorithm for the metrics to determine objects' similarities... With specific objects such as yours when the generic engine doesn't manage to properly match the objects, isSimilar() is the way to go.

Laurent Goubet
Obeo

Guillaume Chatelet a écrit :
Ok, looking closer to the code, I understood I had to write my own MatchEngine (extending from GenericMatchEngine) and override the GenericMatchEngine#isSimilar(EObject obj1, EObject obj2) function.

Guillaume Chatelet wrote:

Hello Laurent,

I'd like to compare two objects, say o1 and o2. Those objects contain an EList<IMyObject>.

The compare is pretty difficult because the lists might be shuffled and the object might change a lot.

In order for the diff ordering to be efficient I need rules to ensure that two IMyObject are similar. Otherwise the diff algorithm will conclude with a lot of additions and deletions in the list. So I need to precise what makes two IMyObject similar or not. I already played with ReferencesCheck#shouldBeIgnored(EReference) and AttributesCheck#shouldBeIgnored(EAttribute) as you proposed but it's not enough. I need to compute intermediate metrics and maybe to give some attributes more importance than others.

Do you think this is something that fits in EMF Compare's framework ? How can I do this ?

Best regards,
Guillaume


begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr/";>Obeo</a>
email;internet:laurent.goubet@xxxxxxx
url:http://www.obeo.fr
version:2.1
end:vcard