Jump to: navigation, search

EMF Compare/API MetamodelRequiresLink

< EMF Compare
Revision as of 11:59, 12 October 2011 by Cedric.notot.obeo.fr (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A reference 0..n has been added in the "diff" meta-model to manage dependencies between difference elements (DiffElement). This reference is named "requires". There is an opposite one which is named "requiredBy".

This reference may be used from different levels.

- The "requires" link is automatically filled in the generic EMF Compare core, deducing these dependencies from the dependencies between the model objects referenced by the difference elements.

It is considered that object 'A' depends on object 'B' if 'A' owns a reference to 'B' at least. The aim is to keep the integrity of the dependencies between model objects, after any partial merge process. So, if 'A' has to be copied in the merge action, its references to 'B' have to be copied too and, consequently, if 'B' does not exist in the target model, it has to be copied. In this case, the difference on 'A' will own a dependency to the difference on 'B', through the 'requires' link.

Only two kinds of difference are concerned by the filling of this link: - The model element changes: It is the previous example. 'A' does not exist from one side of the comparison. - The reference changes: 'A' exists from the both sides but it's one of its references which changed (for example: from 'C' to 'B'). If 'A' is copied, 'B' must be copied too.