You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #80, we decided that references within one language use the id of the target, as the language elements are "just nodes".
We use key only if we cross M1 -> M2 boundaries (or M2 -> M3, respectively).
Example
In Repo alpha, we have:
Language Trees [id: 100, key: asdf]
version: 1
concept Tree [id: 1, key: A]
property height: integer [id: 2, key: B]
concept Pine extends Tree [id: 3, key: C]
property needleLength: integer [id: 4, key: D]
A bit later we want to import Bonsais into repo beta.
beta can find neither "Bonsai extends Tree" nor "reference similarTo: Pine" target, thus it stores
Option B: Keep as is (model → metamodel uses key, metamodel → metamodel uses id)
Pro:
Everything is a model
Con:
Incremental language import might be broken
Option C: enforce id == key
Pro:
Solves import case
Con:
Cannot handle two copies of the same metamodel in same repo
Considerations
The use case of incremental importing metamodels is not that uncommon. Example: A client lazily loads required languages. It needs to relate already loaded metamodels and their instances with newly loaded ones.
We must be able to ship metamodels to client
Decision: Option B (keep as is)
Rationale: "Everything is a model" is a cornerstone of LIonWeb. We don't want to violate this principle at our core.
Consequence: Incremental language import needs to keep a mapping table around
In #80, we decided that references within one language use the
id
of the target, as the language elements are "just nodes".We use
key
only if we cross M1 -> M2 boundaries (or M2 -> M3, respectively).Example
In Repo alpha, we have:
"Pine extends Tree" is stored as:
Now assume we have a second language:
"Bonsai extends Tree" is stored as:
"reference similarTo: Pine" is stored as:
Assume we exported Language
Bonsais
andTrees
from repo alpha.Now we import
Trees
into repo beta, which uses hash-based ids:Now "Pine extends Tree" is stored as:
A bit later we want to import
Bonsais
into repo beta.beta can find neither "Bonsai extends Tree" nor "reference similarTo: Pine" target, thus it stores
"Bonsai extends Tree" as:
and "reference similarTo: Pine" as:
Do we accept this?
The text was updated successfully, but these errors were encountered: