Instance Creation Tech Note - modelint/shlaer-mellor-metamodel GitHub Wiki
mint.sm-meta.action.tn.5 / Leon Starr / Version 0.1.0
In the Reference actions: tn.4 we saw how a creation action can be combined with a single get reference primitive to create a new instance with a reference to some other instance.
But what do we do with a class holding references across multiple relationships?
Let's consider an example:
images/mint-sm-meta-action-tn-5-image-10.png
And we will populate it with the following scenario, performing a Multi Lane Change
from lane 1 across to lane 4 via a sequence of Single Lane Changes
.
images/mint-sm-meta-action-tn-5-image-20.png
We will use the Get simple reference, Get associative reference, and Create primitives defined in tn4. Here we string them together to instantiate a Multi Lane Change instance, which requires a reference to a Traversal Specification as well as our first Single Lane Change all in one Activity so that we maintain referential integrity.
images/mint-sm-meta-action-tn-5-image-30.png
The Scrall for all this could be written like so:
mlc .= *Multi Lane Change( Turn direction: dir ) &R6 v, dest lane
mlc &R8 spec
mlc &R7 start lane, *Single Lane Change( Target lane open: false, Max time exceeded: false )
It seems that if we want to create an instance without any referential attributes (such as an instance of the Traversal Specification
we need only the Create primitive.
Otherwise, we need a Get simple reference or Get associative reference primitive action for each referenced association.