Skip to content

Simplify entity comparison using meta-description #4

@RomainDeg

Description

@RomainDeg

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
  • Investigate and document model meta-description
  • Rewrite the compareEntity: to: method to rely on model meta-description instead + PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions