Skip to content

Is version part of M3 Metamodel? #7

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

Closed
enikao opened this issue Oct 14, 2022 · 7 comments
Closed

Is version part of M3 Metamodel? #7

enikao opened this issue Oct 14, 2022 · 7 comments

Comments

@enikao
Copy link
Contributor

enikao commented Oct 14, 2022

Do we store the version of a Metamodel not at all, as a property, as an annotation, or in external metadata?

Argument for storing it inside the Metamodel: This way, it can become part of the FQN of the metamodel, so we can disambiguate different versions.

@ftomassetti
Copy link
Contributor

If we store it as part of the Metamodel we could also take it into account when expressing dependencies between Metamodels

@dslmeinte
Copy link
Contributor

It's very tempting. I see this M3 as a way to describe what to expect in an AST, and as such, I'd like to avoid aspects like dependency management etc. as much as possible until it turns out that it's really an improvement. Metadata stored alongside an actual model could serve the purpose of declaring dependencies (and which versions) as well.

@enikao
Copy link
Contributor Author

enikao commented Oct 17, 2022

We should not have both a language version and a model version. Until today, I don't understand what that means in MPS.

@ftomassetti ftomassetti added the M3 label Nov 4, 2022
@enikao
Copy link
Contributor Author

enikao commented Feb 10, 2023

Required for language evolution
MM id stays the same
Then we have several MMs (i.e. nodes) in the repo with the same id
every reference to MM needs both MM id and version

MM A:1
  dependsOn B:1

  concept aa
    reference bb

MM B
  concept bb

@enikao
Copy link
Contributor Author

enikao commented Feb 10, 2023

This is an example as base for discussions.
Please ignore the first-level json object, I need it to render the image.

This assumes a slightly changed M3: Metamodel.dependsOn is a child of type Dependency, so we can store the version.

metamodel-versioning-linked

{
    "metamodel nodes": [
        {
            "id": "1",

            "concept": "LIonCore_M3_Metamodel",
            "properties": {
                "name": "Library",
                "id": "a",
                "version": "7"
            },
            "children": {
                "LIonCore_M3_Metamodel_dependsOn": [
                    "1_1"
                ],
                "LIonCore_M3_Metamodel_elements": [
                    "1_2"
                ]
            },
            "references": {},
            "parent": null
        },
        {
            "id": "1_1",
            "concept": "LIonCore_M3_Dependency",
            "properties": {
                "LIonCore_M3_Dependency_version": "4"
            },
            "children": {},
            "references": {
                "LIonCore_M3_Dependency_metamodel": [
                    {
                        "resolveInfo": "NamedStuff",
                        "reference": "2"
                    }
                ]
            },
            "parent": "1"
        },
        {
            "id": "1_2",
            "concept": "LIonCore_M3_Concept",
            "properties": {
                "LIonCore_M3_NamespacedEntity_simpleName": "Book",
                "LIonCore_M3_NamespacedEntity_id": "a_a",
                "LIonCore_M3_Concept_abstract": "false"
            },
            "children": {
                "LIonCore_M3_FeaturesContainer_features": [
                    "1_3"
                ]
            },
            "references": {
                "LIonCore_M3_Concept_implements": [
                    {
                        "resolveInfo": "INamed",
                        "reference": "2_1"
                    }
                ]
            },
            "parent": "1"
        },
        {
            "id": "1_3",
            "concept": "LIonCore_M3_Property",
            "properties": {
                "LIonCore_M3_NamespacedEntity_simpleName": "pages",
                "LIonCore_M3_NamespacedEntity_id": "a_a_a",
                "LIonCore_M3_Feature_optional": "false"
            },
            "children": {},
            "references": {
                "LIonCore_M3_Property_type": [
                    {
                        "resolveInfo": "integer",
                        "reference": "LIonCore_M3_builtin_integer"
                    }
                ]
            },
            "parent": "1_2"
        },
        {
            "id": "2",
            "concept": "LIonCore_M3_Metamodel",
            "properties": {
                "name": "NamedStuff",
                "id": "b",
                "version": "4"
            },
            "children": {
                "LIonCore_M3_Metamodel_elements": [
                    "2_1"
                ]
            },
            "references": {},
            "parent": null
        },
        {
            "id": "2_1",
            "concept": "LIonCore_M3_ConceptInterface",
            "properties": {
                "LIonCore_M3_NamespacedEntity_simpleName": "INamed",
                "LIonCore_M3_NamespacedEntity_id": "b_a"
            },
            "children": {
                "LIonCore_M3_FeaturesContainer_features": [
                    "2_2"
                ]
            },
            "references": {},
            "parent": "2"
        },
        {
            "id": "2_2",
            "concept": "LIonCore_M3_Property",
            "properties": {
                "LIonCore_M3_NamespacedEntity_simpleName": "name",
                "LIonCore_M3_NamespacedEntity_id": "b_a_a",
                "LIonCore_M3_Feature_optional": "false"
            },
            "children": {},
            "references": {
                "LIonCore_M3_Property_type": [
                    {
                        "resolveInfo": "string",
                        "reference": "LIonCore_M3_builtin_string"
                    }
                ]
            },
            "parent": "2_1"
        }
    ],
    "metamodels": [
        {
            "id": "a",
            "version": "7"
        },
        {
            "id": "b",
            "version": "4"
        }
    ],
    "nodes": [
        {
            "id": "__underscore__",
            "concept": "a_a",
            "properties": {
                "b_a_a": "The Hitchhiker's Guide to the Galaxy",
                "a_a_a": "160"
            },
            "children": {},
            "references": {},
            "parent": null
        }
    ]
}

also checked in at https://github.com/LIonWeb-org/organization/blob/niko/more-leveled-metamodels/lioncore/metamodel-versioning.puml

@enikao
Copy link
Contributor Author

enikao commented Feb 10, 2023

Open questions:

  • Does concept of node with id: __underscore__ refer to a_a (i.e. the concept's id property) or to 1_2 (i.e. the concept's node id)? (See also Metamodel.id/NamespacedEntity.id vs. Node id #80)
  • Does concept of node with id: __underscore__ only refer to the concept or also to the concept's containing metamodel?
    In other words: Do we assume a_a is unique? How to guarantee?
  • Does the id (id property and/or node id) of concept Book change between e.g. version 6 and 7 of metamodel Library?
    This also implies whether we need to know the version of Library in an instance model.
  • How does metamodel version relate to versioned (in the sense of git) models?
  • If we're getting an instance model using Library version 2, but only have version 3 available, should we be able to read the model?
  • If we're getting an instance model using Library version 4, and locally already moved to version 5 (but still have version 4 available), should we be able to read the model?
  • If we're getting an instance model using Library version 7, but only have versions up to and including 6 available, should we be able to read the model?
  • How interchangeable should instance models be between different repositories?

@enikao
Copy link
Contributor Author

enikao commented Mar 6, 2023

Decisions discussed 2023-03-03:

Does concept of node with id: __underscore__ refer to a_a (i.e. the concept's id property) or to 1_2 (i.e. the concept's node id)? (See also #80)

We refer to a_a, the concept's key property (renamed from id) --> #90

Does concept of node with id: __underscore__ only refer to the concept or also to the concept's containing metamodel?
In other words: Do we assume a_a is unique? How to guarantee?

We refer from M1 to M2 via a triplet, discussed in #89. We discuss uniqueness in #91.

Does the id (id property and/or node id) of concept Book change between e.g. version 6 and 7 of metamodel Library?
This also implies whether we need to know the version of Library in an instance model.

No, the key (renamed id property) is stable throughout the life of the M2 element.

How does metamodel version relate to versioned (in the sense of git) models?

They are completely independent and unrelated. LIonCore (M3) makes no assumptions about version control a la git. Any implementation may chose to put M3 instances (aka Metamodels) under version control.

  • If we're getting an instance model using Library version 2, but only have version 3 available, should we be able to read the model?
  • If we're getting an instance model using Library version 4, and locally already moved to version 5 (but still have version 4 available), should we be able to read the model?
  • If we're getting an instance model using Library version 7, but only have versions up to and including 6 available, should we be able to read the model?

This is implementation dependent. LIonWeb shall provide all necessary information so clients can make an informed decision.

How interchangeable should instance models be between different repositories?

We use stable keys to refer from M1 to M2. Thus, M1 chunks are compatible with different repositories, assuming they all know that metamodel.

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

3 participants