Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » [EMF Compare] Equality Helper not used in match phase
[EMF Compare] Equality Helper not used in match phase [message #1673685] Sat, 14 March 2015 12:24 Go to next message
Christoph Heisen is currently offline Christoph HeisenFriend
Messages: 3
Registered: March 2015
Junior Member
Hi,

my model has several containment references to classes without an id attribute. Therefore most of the time the default match engine recognizes changes in the references' attributes as addition/ deletion of a new reference.

My goal is that these references are always matched. So after reading the description
www.eclipse.org/emf/compare/documentation/latest/developer/developer-guide.html#Equality_Helper
I implemented a custom Equality Helper.

What I found is that my custom Equality Helper is not used during match phase.
The IdentifierEObjectMatcher uses the idComputation Function and otherwise delegates (by default) to a ProximityEObjectMatcher.
The ProximityEObjectMatcher does not use the Equality Helper on references. Instead it computes the distance based on their contents to check whether the references match.

Am I missing something? Or is it intentional that custom Equality Helpers are not used during the match phase?

Regards,
Christoph

P.S. I know I can achieve my goal by other means like e.g. a post processor.
Re: [EMF Compare] Equality Helper not used in match phase [message #1679537 is a reply to message #1673685] Mon, 16 March 2015 17:05 Go to previous messageGo to next message
Axel RICHARD is currently offline Axel RICHARDFriend
Messages: 43
Registered: September 2010
Location: France
Member
Hi,

First of all, thanks to use EMF Compare. Unfortunately, there are lacks on EMF Compare to customize easily the EqualityHelper.
The steps to tell to EMF Compare to use you own EqualityHelper are not very easy, but it is possible. You have to :
1- Create your EqualityHelper by implementing org.eclipse.emf.compare.utils.IEqualityHelper (see the default implementation to get help: org.eclipse.emf.compare.utils.EqualityHelper, you can also extends it)
2- Create your EqualityHelperFactory by implementing org.eclipse.emf.compare.match.IEqualityHelperFactory (see the default implementation to get help: org.eclipse.emf.compare.match.DefaultEqualityHelperFactory, you can also extends it)
This factory will use your EqualityHelper
3- Create your MatchEngine by implementing org.eclipse.emf.compare.match.IMatchEngine (see the default implementation to get help: org.eclipse.emf.compare.match.DefaultMatchEngine, you can also extends it)
This matchEngine will use your EqualityHelperFactory
4- Create your MatchEngineFactory by implementing org.eclipse.emf.compare.match.IMatchEngine.Factory (see the default implementation to get help: org.eclipse.emf.compare.rcp.internal.match.DefaultRCPMatchEngineFactory, you can also extends it)
This factory will use your MatchEngine
5- Use the org.eclipse.emf.compare.rcp.matchEngine extension-point to register your MatchEngineFactory.
The ranking must be superior to the existing one. (e.g > 0)

Hope it will help.

Regards,


Axel Richard
Obeo
Re: [EMF Compare] Equality Helper not used in match phase [message #1682074 is a reply to message #1679537] Tue, 17 March 2015 15:34 Go to previous messageGo to next message
Christoph Heisen is currently offline Christoph HeisenFriend
Messages: 3
Registered: March 2015
Junior Member
Hi Axel,
thanks for the reply.

I have done steps 1 to 4. Instead step5 I did the programatic approach as for some reason the extension point mechanism did not work for me.

What I see is that my Equality Helper is stored in Comparison Object that is being passed around during the comparison process.
But neither the IdentifierEObjectMatcher nor the ProximityEObjectMatcher is using it. The ProximityEObjectMatcher uses EditionDistance. There an EqualityHelper is used. But not my custom one as the EditionDistance uses its own "fakeComparison" object and not the comparison object that is passed around.

I debugged the whole match phase to see this.

Best regards,
Christoph
Re: [EMF Compare] Equality Helper not used in match phase [message #1686744 is a reply to message #1682074] Thu, 19 March 2015 10:30 Go to previous messageGo to next message
Axel RICHARD is currently offline Axel RICHARDFriend
Messages: 43
Registered: September 2010
Location: France
Member
Hi,

Sorry for that. I raised an enhancement bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=462547 to let users to provide their own EqualityHelpers.

Regards,


Axel Richard
Obeo
Re: [EMF Compare] Equality Helper not used in match phase [message #1688174 is a reply to message #1686744] Fri, 20 March 2015 09:11 Go to previous message
Christoph Heisen is currently offline Christoph HeisenFriend
Messages: 3
Registered: March 2015
Junior Member
Hi,
thank you for raising that enhancement request.

To be more precise:
I have seen my custom EqualityHelper bein called in the differencing phase.
But I have not seen it being called in the matching phase.

My focus is on the matching phase so I have not investigated the other phases further.

This leads to my original question.
Is it intended that custom Equality Helpers are used in the matching phase or not?

I am unsure of this because from the description of the developer guide it would seem so. Yet I am not sure whether that description is up-to-date.

Regards,
Previous Topic:Diff include change to EStructuralFeature ID
Next Topic:Transform the objects to be compared before the comparison operation
Goto Forum:
  


Current Time: Sat Dec 14 23:06:09 GMT 2024

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

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

Back to the top