public class CoreographyBuilder
extends java.lang.Object
The main entry method is calculate(EClass, EClass)
, which performs
the following actions:
DijkstraSolver
) String
representing the sequence diagrampñ'-
The sequence diagram is represented as a String
to be transformed into a picture
by means of the tool js-sequene-diagrams
Modifier and Type | Field and Description |
---|---|
private org.eclipse.emf.ecore.EPackage |
domain
The general APIs domain discovered
|
Constructor and Description |
---|
CoreographyBuilder(org.eclipse.emf.ecore.EPackage ePackage)
Constructs a new
CoreographyBuilder element given a metamodel (as EPackage |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
calculate(org.eclipse.emf.ecore.EClass source,
org.eclipse.emf.ecore.EClass target)
Searches for a possible path between two metamodel classes (as
EClass elements), if
exists, a sequence diagram is returned as String . |
java.lang.String |
discoverMapping(org.eclipse.emf.ecore.EClass source,
org.eclipse.emf.ecore.EClass target)
Searches for mappings between two metamodel class (as
EClass elements)
Attributes of each metamodel class are traversed and, if they are similar (calculated
with method isSimilar(EAttribute, EAttribute) ) a mapping between
such attributes is created. |
private boolean |
isSimilar(org.eclipse.emf.ecore.EAttribute source,
org.eclipse.emf.ecore.EAttribute target)
Calculates if two attributes (as
EAttribute elements) are similar. |
private org.eclipse.emf.ecore.EPackage domain
public CoreographyBuilder(org.eclipse.emf.ecore.EPackage ePackage)
CoreographyBuilder
element given a metamodel (as EPackage
ePackage
- The metamodel (as EPackage
public java.lang.String calculate(org.eclipse.emf.ecore.EClass source, org.eclipse.emf.ecore.EClass target)
EClass
elements), if
exists, a sequence diagram is returned as String
.
This method applies first the Dijsktra algorithm to calculate all the possible shortest
path for a given source node (see DijkstraSolver
). Then, the shortest path with regard
to a target node is retrieve (if exists) and finally the sequence diagram is generated.
The sequence diagram is represented as a String
to be transformed into a picture
by means of the tool js-sequene-diagrams
source
- The source node (as EClass
)target
- The target node (as EClass
)public java.lang.String discoverMapping(org.eclipse.emf.ecore.EClass source, org.eclipse.emf.ecore.EClass target)
EClass
elements)
Attributes of each metamodel class are traversed and, if they are similar (calculated
with method isSimilar(EAttribute, EAttribute)
) a mapping between
such attributes is created.
Mappings are currently represented as String
s following the pattern:
[source attribute name] -> [target attribute name]
If several mappings are located, the resulting String
is a comma-separated result
source
- The source metamodel class (as EClass
)target
- The target metamodel class (as EClass
)String
with the discovered mappingsprivate boolean isSimilar(org.eclipse.emf.ecore.EAttribute source, org.eclipse.emf.ecore.EAttribute target)
EAttribute
elements) are similar.
The similarity is checked according to number of matching characters between
the two given String
s. Currently the threshold to be considered similar
is 0.25.
source
- The source EAttribute
target
- The target EAttribute
EAttribute
are considered similar