Lineage - modelint/shlaer-mellor-metamodel GitHub Wiki
To instantiate a real world entity that participates in one or more Generalizations, it is necessary to instantiate multiple Facets.
For example, an aircraft in the real world is instantiated in our example model as two instances, Aircraft
and Fixed Wing Aircraft
.
In the simplest case, only one Generalization is involved requiring a single Superclass instance and a single Subclass instance.
Incomplete entities are illegal. So it is always necessary to leave a complete entity or no entity at the conclusion of a runtime transaction. (It is up to the modeler to organize processing into adequately independent transactions). It is not okay, to create a Superclass instance and then omit the required Subclass instance or vice versa.
If an entity can migrate to a different specialization (change its Subclass), it is necessary to ensure that enough new Instances are created to end up with a complete Object while ensuring that all all Instances pertinent only to the prior specialization are deleted. In the single Generalization case, this simply means creating one new Subclass instance and deleting one old Subclass instance.
It gets a bit more interesting when multiple Generalizations are interconnected as shown.
images/relationship-subsystem/lineage-10.png
In the example above, instantiation of D requires instantiation of the Facets A, E, H and G. Note that the R3 specialization is predetermined by the choice of D in R1. E must be specialized as G. Fortunately, a straightforward algorithm can be run at metamodel population time (model edit time) to determine which lineage of Facets must be instantiated or deleted as a group. Lineages for the above example are shown here:
images/relationship-subsystem/lineage-20.png
There are a few advantages to incorporating the Lineage concept into the metamodel. It makes it possible to validate the integrity of Generalization data (M0) populations. A model editor can take advantage of this information to warn the model developer when action language yields an incomplete entity. Also, the metamodel can be consulted during action language execution to verify correct instantiation.
Furthermore, the Lineage concept is essential when verifying that a newly created Subclass does not, through a chain of references end up as a Superclass of itself and vice versa.
images/relationship-subsystem/lineage-30.png
And by incorporating a Lineage tracing algorithm into the metamodel, there is no need for each model editor to reinvent a potentially faulty algorithm. But perhaps the most important reason for modeling Lineage is to provide a precise meaning of ‘real/abstract world entity’.
Identifiers
- Lnum + Domain
Attributes
Lnum
A number in the form LIN starting from 1, such as LIN1, LIN2, ...
Type: Lineage Number, based on Nominal