Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Compare 2 EObjects with that same model(Compare 2 EObjects with that same model)
Compare 2 EObjects with that same model [message #1053777] Tue, 07 May 2013 10:36 Go to next message
Andrew Whelan is currently offline Andrew Whelan
Messages: 69
Registered: October 2012
Location: Syracuse NY
Member
Hello,

I am looking to compare 2 EObjects. These 2 EObjects are from the same data model. All I am looking for is something (relatively simple) that will return some kind of structure, like the following.

DiffStructure diffObject = EMFDiff.(eObject1, eObject2);

I would then be able to recurse the diffObject to find what has changed from the 1st object (object1) to the second (object2).

Does something close to this exist? EMFCompare seems to compare differences in models? I am looking to compare two EObjects from the same model.

Any information on this will be appreciated.

Thanks
-Andy
Re: Compare 2 EObjects with that same model [message #1058304 is a reply to message #1053777] Mon, 13 May 2013 10:04 Go to previous message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1622
Registered: July 2009
Senior Member
Andrew,

See the FAQ. Though the code sample uses URIs and Resources to create the comparison scope, you can use plain EObjects instead. All you need is to replace the line

IComparisonScope scope = EMFCompare.createDefaultScope(resourceSet1, resourceSet2);


with

IComparisonScope scope = EMFCompare.createDefaultScope(leftEObject, rightEObject);


Laurent Goubet
Obeo
Previous Topic:[EMF Compare] Using EMF Compare visual diff with files that have .xml extension
Next Topic:[EMF] Get element name of an EObject
Goto Forum:
  


Current Time: Fri Aug 01 02:05:46 EDT 2014

Powered by FUDForum. Page generated in 0.12260 seconds