LionWeb-io / specification

Specifications of the LionWeb initiative
http://lionweb.io/specification/
7 stars 0 forks source link

How to handle commands with invalid optional parameter value? #312

Open enikao opened 1 week ago

enikao commented 1 week ago

In #287, we've decided to include optional parameter values.

If a client sends optional parameter values that are inconsistent with the repository's state, how to react?

Example: Client sends changeConcept(node=myNodeId, oldConcept=Line, newConcept=Point). In the repository, node with id myNodeId currently has concept Arc, not Line.

Note: This applies to lots of commands.

Option A: Ignore optional parameter

Repository sets myNodeId.concept = Point, irrespective of the oldConcept parameter.

Pro:

Con:

Option B: Refuse command

Repository does not execute the command, informs client about being outdated

Pro:

Con:

Option C: Repo decides

Repository can decide, in accordance with its merge and conflict resolution strategy, whether to ignore optional parameter (i.e. option A) or refuse command (i.e. option B).

Pro:

Con:

dslmeinte commented 5 days ago

Option D: Repo sends back corrected optional parameter values.