Skip to main content

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 14:36 Go to next message
Andrew Whelan is currently offline Andrew WhelanFriend
Messages: 69
Registered: October 2012
Location: Syracuse NY

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.

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

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);


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

Laurent Goubet
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: Mon May 28 08:09:14 GMT 2018

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

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

Back to the top