ls1intum / Apollon

UML Modeling Editor written in React
https://apollon-library.readthedocs.io
MIT License
68 stars 22 forks source link

CommunicationLink + Messages #135

Open TobiasPr opened 4 years ago

TobiasPr commented 4 years ago

Describe the bug

CommunicationLink + Messages are currently implemented in a way, that they are not kept normalized in the application state. This does not cause a problem right now, but potentially in the future.

Usually the application state is normalized. So CommunicationLink should reference its CommunicationLinkMessages by id. Currently the CommunicationLink has a full refernce to the element. This leads to inconsistency in the application state, e.g.: If a CommunicationLinkMessage is updated via the UMLElementRepository.update function, the changes are not communicated to the parent, i.e. the CommunicationLink. Thus when accessing the message later again via the CommunicationMessage, it will not contain the messages.

Expected implementation

CommunicationLink should update CommunicationLinkMessages by id. The drawback of this is, that it would change the data model and we would lose backwards compatibility, meaning previous created CommunicationDiagrams may not work anymore

At some point in the future this should be fixed, when we need to change the DataModel anyway