Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » EMF Compare Documentation
EMF Compare Documentation [message #671365] Tue, 17 May 2011 16:03 Go to next message
Frank is currently offline FrankFriend
Messages: 7
Registered: May 2011
Junior Member
Greetings Everyone,

Is there any place where I can find information on EMF Compare. I have checked the FAQ but I was wondering if there was somewhere else where I could find more detailed information and/or samples.


Thanks in advance,
Frank
Re: EMF Compare Documentation [message #696225 is a reply to message #671365] Wed, 13 July 2011 14:25 Go to previous messageGo to next message
Cedric Brun is currently offline Cedric BrunFriend
Messages: 431
Registered: July 2009
Senior Member
The wiki is a good place :

http://wiki.eclipse.org/EMF_Compare

Have a look on the integrated help content in Eclipse too.

And these blogs :

http://model-driven-blogging.blogspot.com/search/label/compare

http://eclipsemde.blogspot.com/


http://cedric.brun.io news and articles on eclipse and eclipse modeling.
Re: EMF Compare Documentation [message #1007685 is a reply to message #671365] Thu, 07 February 2013 05:41 Go to previous messageGo to next message
Phillip Drew is currently offline Phillip DrewFriend
Messages: 77
Registered: October 2012
Member
I can't seem to find any useful examples of using EMF compare and interpreting the results of a comparison.

The sections that look promising on the wiki are basically TODO statements, there isn't a javadoc API to use and most of the examples I can find across the internet don't seem to be using the latest version (or are even confused between multiple versions).

EMF Compare looks great for a project I'm currently working on except that I can't find out to use it!
Re: EMF Compare Documentation [message #1007915 is a reply to message #1007685] Fri, 08 February 2013 08:03 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Phillip,

Updating the wiki is an undergoing effort. The PENDING statements are there as placeholder for both us (we have something to write under that section) and the users (yes, there will be some doc there once we're done... but please be patient). For things that are not yet on the wiki, there is the forum : you are in the right place ... but you did not state your question clearly. Developers are there to create cool things for users to use; we need communication between the two parties in order for anything to get done. But communication comes from both sides...

Since you talk about API and javadoc, I'd assume that you just want to know how to call EMF Compare programatically... but that's explained in the FAQ. As for the javadoc, it is accessible through simply installing EMF Compare sources from the update site (the update site for M5 is this one, see also the download page).

What exactly are you trying to accomplish?

Laurent Goubet
Obeo
Re: EMF Compare Documentation [message #1007948 is a reply to message #1007915] Fri, 08 February 2013 12:10 Go to previous messageGo to next message
Klaus Birken is currently offline Klaus BirkenFriend
Messages: 25
Registered: December 2009
Junior Member
Hi,

I am also trying to compare two models programmatically with EMF Compare 2.0. I looked at the FAQ as recommended above, but also the FAQ example doesn't work:

EMFCompare.builder().build().compare(scope);

In org.eclipse.emf.compare_2.0.0.201209121410, the EMFCompare class doesn't have a member function builder(). Is a newer version of the software available or is there an update to the example code from the FAQ?

Thanks in advance, regards,
Klaus
Re: EMF Compare Documentation [message #1008046 is a reply to message #1007948] Fri, 08 February 2013 16:06 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Klaus,

The example from the FAQ shows the latest available API to launch comparison. This comes from 2.1, the version that will be shipped with Kepler in June, and the most stable (2.0 was really just a stepping stone). Please use the 2.1.0M5 build (installable either from (the EMF Compare 2.1 milestones update site or from the Kepler staging repository).

If you wish to keep 2.0, you can use (do note that this code will fail as soon as you update to 2.1) :
EMFCompare.newComparator(scope).compare();


Laurent Goubet
Obeo
Re: EMF Compare Documentation [message #1008091 is a reply to message #1008046] Fri, 08 February 2013 21:35 Go to previous messageGo to next message
Klaus Birken is currently offline Klaus BirkenFriend
Messages: 25
Registered: December 2009
Junior Member
Hi Laurent,

thanks for the clarification - I switched to 2.1.0M5 and it works fine.

Regards,
Klaus
Re: EMF Compare Documentation [message #1008143 is a reply to message #1008091] Sun, 10 February 2013 22:37 Go to previous messageGo to next message
Phillip Drew is currently offline Phillip DrewFriend
Messages: 77
Registered: October 2012
Member
Basically I'm trying to compare two ecore models to see what has changed between them. There are lots of examples of calling into the EMF compare API but very few (as far as I can find none) that give a meaningful explanation of how to interpret the comparison results.
Re: EMF Compare Documentation [message #1008163 is a reply to message #1008143] Mon, 11 February 2013 08:39 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Phillip,

If you are comparing models programmatically and wish to understand the differences between merging them, then indeed, the wiki is far from complete on this aspect. You will have to delve a little deeper within the code to understand what's going on. A very concise description of each concept can be found in the metamodel itself as annotations attached to the different elements (see org.eclipse.emf.compare/model/compare.ecore).

Basically, the Comparison object acts as the root of the comparison, it is created at the very beginning of the comparison process and will be further refined by the subsequent phases. It contains Match elements that act as the bridge between the compared models (A in left corresponds to A' in right). Under each Match are other Match elements to mimic the "tree" structure of the input models... but more importantly they contain Diff elements that represent the actual differences (A renamed to A'). These are the elements of the Comparison that are important for you.

Diff can be of three kind : ResourceAttachmentChange, ReferenceChange and AttributeChange. The latter two are self-describing, the first should be quite rare except if you're using fragmented models.



  • ResourceAttachmentChange differences describe changes on the roots of Resources. Creating a new root, deleting a root, controlling an element (creating a fragment through the Right-click > Control... action in the ecore editor) or un-controlling an element will all result in differences of that kind. The element that changed is the parent Match of that diff.
  • ReferenceChange differences are changes on elements' references. Adding (or removing) an element in (or from) a multi-valued reference, (un)setting a mono-valued reference, moving an element (the "reference" in this case is actually the containment reference...) all result in differences of that kind. The parent Match of the Diff is the object for which one of the references as changed, the value of the Diff represents the element that actually changed within that reference (it was added, deleted, or moved).
  • AttributeChange differences are exactly the same as ReferenceChanges ... but for attributes instead of references.


Other than the differences, the Comparison object can contain a number of associations :

  • A Conflict represents a conflict between two or more differences. For example, removing A from the left model, but renaming A to A' in the right (as compared to their common ancestor) results in a conflict. Conflicts can be of two kind : REAL conflicts are the conflicts that cannot be automatically resolved (such as the example given above) while PSEUDO conflicts can be automatically merged. An example of the latter is if you delete A from both left and right model (as compared to their common ancestor). Conflicts can only be detected when comparing three models.
  • An Equivalence relation links together differences that will all be resolved when we merge one of them. This is mostly the case for Ecore's eOpposite references : if I merge a difference on one reference, its eOpposite will automatically be updated. That's what we call equivalences.


This is very concise, but should explain the basis of what information the Comparison model holds. I cannot take the time on the forum to detail much : you will have to wait for us to write the whole documentation and fill the wiki. Do not hesitate to ask more precise questions though.

Laurent Goubet
Obeo
Re: EMF Compare Documentation [message #1011197 is a reply to message #1008163] Tue, 19 February 2013 03:29 Go to previous messageGo to next message
Phillip Drew is currently offline Phillip DrewFriend
Messages: 77
Registered: October 2012
Member
No worries, Laurent. Thanks for the brief intro. Hopefully it'll be enough for me to pick my way through the rest.
Re: EMF Compare Documentation [message #1011306 is a reply to message #1011197] Tue, 19 February 2013 09:23 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
As a side note, the description of the Diff element in itself has been updated on the wiki
Previous Topic:Extracting only differences from model comparison
Next Topic:Graphical comparison specification note
Goto Forum:
  


Current Time: Thu Mar 28 13:30:11 GMT 2024

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

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

Back to the top