The comparison of entities is made on their properties and relations to other entities.
To find the elements to compare, we currently query the class of the entities to compare to get the slots using the standard Pharo API.
compareEntity: aFamixEntity to: otherFamixEntity
| properties relations |
aFamixEntity class = otherFamixEntity class ifFalse: [ ^ self fail ].
"Comparing properties (slots with non-famix values)"
properties := aFamixEntity class allSlots select: [ :slot |
slot class = FMProperty ].
properties do: [ :p |
(p read: aFamixEntity) = (p read: otherFamixEntity) ifFalse: [
^ self fail ] ].
"Comparing relations (slots with famix values)"
relations := aFamixEntity class allSlots select: [ :slot |
slot isFMRelationSlot ].
relations do: [ :r |
(self compareRelation: r from: aFamixEntity to: otherFamixEntity)
ifFalse: [ ^ self fail ] ].
"Every slot value is equal, the entities are identical"
^ true
The comparison of entities is made on their properties and relations to other entities.
To find the elements to compare, we currently query the class of the entities to compare to get the slots using the standard Pharo API.
compareEntity: to:method to rely on model meta-description instead + PR