Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we want generic or detailed delta messages? #284

Open
enikao opened this issue Jul 5, 2024 · 0 comments
Open

Do we want generic or detailed delta messages? #284

enikao opened this issue Jul 5, 2024 · 0 comments

Comments

@enikao
Copy link
Contributor

enikao commented Jul 5, 2024

For updating property values, we could either have one message propertyValueChanged(property, newValue?, oldValue?) or have propertyAdded(property, newValue), propertyChanged(property, newValue, oldValue) and propertyRemoved(property, oldValue). Similar for other actions.

Even more generic: featureChanged(feature, oldValue, newValue)

Options for links:

Generic:
changeChild(oldLink?, newLink?, oldParent?, newParent?, oldIndex?, newIndex, child)

Detailed:
addChild(link, newChild, index)
removeChild(link, oldChild | index)
moveChild(link, child, newIndex)
moveChild(oldLink, newLink, oldParent, newParent, oldIndex, newIndex, child)

Option A: generic

Pro:

  • Slightly easier to implement event handlers with few methods
  • More similar to bulk API

Con:
changeChild() has lots of optional parameters in different combinations, need to be figured out in every client

Option B: detailed

Pro:

  • Easier to interpret events
  • Might have "duplicate" events removeChild/addChild anyways, so always need to process detailed events

Con:

  • Slightly easier to (erroneously) send Remove + Add instead of change

Decision: Option B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant