Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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: Wed Jul 09 08:52:21 EDT 2025

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

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

Back to the top