Skip to content

Should serialization contain a list of used languages? #76

Description

@enikao

Both MPS and EMF store the list of used languages in their storage files. We could do the same:

{
  "serializationFormatVersion": "1",
  "languages": [
    {
      "key ": "idOfLibraryMetamodel",
      "version": "1"
    },
    {
      "key": "idOfMapMetamodel",
      "version": "1"
    },
    {
      "key": "namedStuffMetamodel",
      "version": "1"
    },
  ],
  "nodes": [
    {
      "id": "aaa",
      "language": ,
      "concept": {
        "language": "idOfLibraryMetamodel",
        "version": "1",
        "key": "libraryTravelBook"
      },
      "properties": [
        {
          "property": {
            "language": "namedStuffMetamodel",
            "version": "1",
            "key": "namedStuffName"
          },
          "value": "Discover Rome"
        }
      ],
      "children": [],
      "references": [
        {
          "reference": {
            "language": "idOfLibraryMetamodel",
            "version": "1",
            "key": "bookMaps"
          },
          "targets": [
            {
              "resolveInfo": "Rome",
              "reference": "bbb"
            }
          ]
        }
      ]
    },
    {
      "id": "bbb",
      "concept": {
        "language": "idOfMapMetamodel",
        "version": "1",
        "key": "cityMap"
      },
      "properties": [
        {
          "property": {
            "language": "namedStuffMetamodel",
            "version": "1",
            "key": "namedStuffName"
          },
          "value": "Roma"
        }
      ],
      "children": [
        {
          "containment": {
            "language": "idOfMapMetamodel",
            "version": "1",
            "key": "sizeId"
          },
          "children": [
            "ccc"
          ]
        }
      ],
      "references": []
    },
    {
      "id": "ccc",
      "concept": {
        "language": "idOfMapMetamodel",
        "version": "1",
        "key": "GroundArea"
      },
      "properties": [
        {
          "property": {
            "language": "idOfMapMetamodel",
            "version": "1",
            "key": "squareKilometers"
          },
          "value": "1285"
        }
      ],
      "children": [],
      "references": []
    }
  ]
}
  • idOfLibraryMetamodel is required for libraryTravelBook and bookMaps
  • idOfMapMetamodel is required for cityMap, sizeId, GroundArea, and squareKilometers
  • namedStuffMetamodel is required for namedStuffName

Pros:

  • Easy to determine for a client whether they can work with the metamodel

Cons:

  • Redundant information, thus another way to screw up the format

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions