Skip to content

Repo API: Represent dangling pointers #35

@enikao

Description

@enikao

We represent links (i.e. both children and references) by their id.
How do we handle the case that the node with this id is not logically contained in the result set (because it's out of scope of the query)?

Aspects

  • Distinguish invalid link targets from not loaded ones
  • Know the type of the target node (might be useful for e.g. EMF-based implementation)

Possible representations

Just target id

Example:

{
  "containsProxies": true
  "nodes": [
    {
      "id": "a",
      "type": "PetOwner",
      "references": {
        "myPet": "x" // no node with id "x" present
      }
    }
  ]
}
  • Less data
  • Cannot distinguish between invalid id and unresolved id
  • Server could send back a flag whether data contained any proxies

Proxy for target

Example:

{
  "nodes": [
    {
      "id": "a",
      "type": "PetOwner",
      "references": {
        "myPet": "x"
      }
    },
    {
      "id": "x",
      "type": "Dog",
      "state": "[full | proxy | invalid]"
    }
  ]
}
  • After just reading the list of nodes, we know whether we have an unresolved reference
  • We can easily know reference target type
  • Can differentiate between invalid id and unresolved id
  • If querying closure and result contains invalid id, client can identify them

=> Decision: For now, don’t store proxies in node list. Might be changed in the future (compatible, additive API change).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions