Informatievlaanderen / OSLO-UML-Transformer

Software components that are used within the OSLO Toolchain
MIT License
5 stars 3 forks source link

More stable uniqueId function #2

Closed ddvlanck closed 2 years ago

ddvlanck commented 2 years ago

Issue type:


Description:

The uniqueId generates a unique identifier that can be used to uniquely identify objects on a UML diagram. Within the OSLO EA Converter, this is necessary because a connector is normalized and can lead up to multiple new instances of that connector, sharing the same internal EA guid, making it not unique anymore.

However, the uniqueId function takes the current timestamp as the starting point for creating a unique id. As a result, for each new 'run', each object gets a new unique id, making it difficult to compare 2 files.

To get this more stable, the unique id should be calculated based on certain properties of the objects. This will ensure that if an object is not changed in a new 'run', the id will be the same.

The npm package object-hash was already used to experiment with, generating hashes based on the whole object, but this slows the program down too much.

ddvlanck commented 2 years ago

This function was updated and uses the enterprise architect guid, name and object id as input for a SHA256 hash.