Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Ignoring Elements completely in custom Match and Diff Engine
Ignoring Elements completely in custom Match and Diff Engine [message #901012] Thu, 09 August 2012 11:59 Go to next message
Benjamin Klatt is currently offline Benjamin KlattFriend
Messages: 36
Registered: September 2010
Member
Hi,

I am working on a custmization to compare java models discovered using the MoDisco tooling.

Such models can contain class declarations etc. from packages which I am not interested in. So I would like to ignore all elements and possible changes from classes, interfaces, etc. in those packages.

Up to know, I implemented such a filter in the processUnmatchedElements() of a custom DiffEngine extending the GenericDiffEngine.
I also handle those elements within a custom MatchEngine and there are other methods in the custom DiffEngine I will have to adapt to filter diffs of JavaModel elements from specific packages.

However, I was wondering if there is a method I could adapt to specify model elements which should be completely ignored to
1) not have to implement filters in a lot of methods scattered around the code
2) improve performance by filtering them right at the beginning of the process.

Thanks a lot
Benjamin
Re: Ignoring Elements completely in custom Match and Diff Engine [message #903325 is a reply to message #901012] Thu, 23 August 2012 07:50 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Benjamin,

EMF Compare 1.* did not provide any easy mean to filter out elements entirely. What you are currently doing is the easiest way to do so.

The current development effort focuses on EMF Compare 2.0; and this version will be much more simple in terms of customization. If you are not too far in your customization, and mainly use EMF Compare for models with identifiers (XMI ID or ID attributes), you might want to start with this version instead. It will be what we contribute to Kepler in the Eclipse yearly release for 2013, and it breaks most APIs since it is a total re-thought of the comparison process.

If you do give a chance to EMF Compare 2, what you need to provide is an implementation of the IComparisonScope that removes the elements you do not wish compared. You can then pass this on to EMFCompare.compare().

Laurent Goubet
Obeo
Re: Ignoring Elements completely in custom Match and Diff Engine [message #1027240 is a reply to message #901012] Tue, 26 March 2013 18:43 Go to previous messageGo to next message
Jaime DaRosa is currently offline Jaime DaRosaFriend
Messages: 1
Registered: March 2013
Junior Member
Hi,

Could you provide a code snippet that shows how to filter out an element in the IComparisonScope implementation for this scenario?

Thanks,
Jaime
Re: Ignoring Elements completely in custom Match and Diff Engine [message #1032584 is a reply to message #1027240] Wed, 03 April 2013 07:16 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Jaime,

Please ask your questions in a separate thread... and describe what you want (what could "this scenario" be?).

You might also want to look at the IComparisonScope javadoc and existing implementations... For example the FilterComparisonScope that simply asks you for a predicate to filter objects.

Laurent Goubet
Obeo
Previous Topic:Configuring EMF Compare
Next Topic:org.eclipse.emf.compare.edit might be in the wrong feature
Goto Forum:
  


Current Time: Tue Mar 19 02:27:58 GMT 2024

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

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

Back to the top