braid-org / braid-spec

Working area for Braid extensions to HTTP
https://braid.org
233 stars 16 forks source link

sync9(json) vs. sync9(partially-ordered-tree) #9

Closed toomim closed 4 years ago

toomim commented 4 years ago

Duane points out that the "json" merge type should maybe be called something more abstract, like "partially-ordered-tree":

I'm reading the current draft of Braid-Patch (which is awesome, nice job!) and have a thought:

 XML files have an isomorphic partial ordering with JSON files.  You
 could conceivably re-use a JSON synchronizer on an XML file by
 converting the XML to JSON, merging the JSON, and then converting the
 result back when necessary.  However, you can do the same thing by
 connecting an XML parser to a JSON merger, since their partial orders
 are compatible

I feel like there is a "spec smell" here (akin to a "code smell", haha). It seems like if a JSON synchronizer can be re-used in an XML Content-Type then there is perhaps an underlying concept that needs expression. Perhaps the "sync9(json)" merge type should be renamed to something that both XML and JSON would need to merge? For example: braid(xml, sync9(partially-ordered-tree)) ? Is there a reason one would choose a JSON merge type over an XML merge type for an XML Content-Type?

I don't think I have the right alternative name ("partially-ordered-tree") but I'm trying to suggest/point to something more generic. Curious about your thoughts.

I agree. I haven't come up with the better name yet, but partially-ordered-tree sounds ok with me too. Since this is just an example, we can name it whatever communicates the idea best in this case.

mitar commented 4 years ago

I think partially-ordered-tree reads like it is something about trees, and not a structure of lists and objects, which what I think we are implying here?

mitar commented 4 years ago

So for now we went with json to mean JSON and JSON-compatible. Is this OK? I prefer this because people know what it means. The fact that you can apply it to other things as well is nice, but I do not think we should go so deep in the spec.

toomim commented 4 years ago

I think a key thing here is that we have removed all the discussion of partial orders.

I think that is ok, because I think our goal right now is to engage people, and if people end up having questions that need partial orders to answer them, then we can talk about that then.

So I'm closing this now.