I'm trying to refactor the feature of the application responsible for sharing certain entities.
As of now it works as follows:
-
Every entity has a field with
coOwnerIds
(a list of ids of the users that this entity has been shared with), it also has a field calledsyncedWith
that contains a list of ids of the entity has been synchronised with. When such an entity gets shared, its clone is created for the user it gets shared with. Thus those clones must be synchronised with the original as well as each other. -
When some update on any of those entities occurs, that update should also happen on all the clones.
I'm trying to come up with a strategy that would simplify the synchronisation process. I'm thinking of the Observable pattern, but not sure it fits in well for this purpose.
Aucun commentaire:
Enregistrer un commentaire