I am new to EMF Compare and I want to create my own matching strategy. I found the presentation "What every developer should know about EMF Compare" which have some code snippets on how to create a custom matching strategy (Couldn't add the presentation link here). But it seems classes like GenericMatchEngine and MatchModel are not part of the latest EMF Compare version (3.x) anymore. I also read the Overriding the Match engine section from EMF Compare Developer Guide, and I was expecting an example of how to extend DefaultMatchEngine. Can someone please provide a link or code snippet about how to customize DefaultMatchEngine?
There is no real example of how to create your own match engine, as that is a very big part of EMF Compare and needs quite a lot of logic. You might want to look at how to implement smaller parts of the matching process. Overriding the match engine tells you how to replace the IMatchEngine as a whole. you'll have to look at the default implementation (DefaultMatchEngine) for an example of the needed logic if you want to go that high level. Otherwise, you might want to take a look at how to replace the IEObjectMatcher (which is explained in the Defining custom identifiers section below the earlier). IEObjectMatchers are the main part of the match engine and that's what will create the "Match" objects that will tell EMF Compare what elements should be diffed with what other one. Even lower level stands the IEqualityHelper that will actually tell EMF Compare (throughout the whole process which EObject is equal to which other. This last part can be replaced by modifying the IEqualityHelperFactory that you'll pass to the comparison factory (you can see that being used in the same section as above, Defining custom identifiers).
As you might guess, overriding this part of the comparison process is far from trivial. Could you share on your use case and what issues you are trying to solve? There might be better ways to tackle this endeavor.
Thank you for your detailed response. I am just playing with the Purchase Order Schema from XML Schema Part 0: Primer Second Edition, w3.org. I want to match two purchaseOrder together even if they have some differences (e.g. price change of particular item, zip code change in billTo etc.). According to your suggestion I guess modifying the id computation of item and billTo using Defining custom identifiers might solve the problem.
If you have a way to compute a stable ID for the purchase orders it will probably resolve your problem. Matching objects without IDs if far from trivial and requires the use of heuristics, which often don't achieve 100% success, unfortunately.
Please let us know how it turns out for your case.