A reference relation is a directed link from a source object to a target object. Unlike containment, it does not make the target owned by, or structurally inside, the source. In an object-relation diagram, containment arrows are solid and reference arrows are dashed. Ignoring references leaves a containment tree; references add the links needed for general structured data. section 2.1
Figure 2.6 Adding and annotating a reference relation
Use the dashed arrow to distinguish a reference from a containment relation and read its property label as the link stored on the source object. section 2.1
Treat a relation as a setting on its source object: the arrow label is the property name, and the target object is its value. A concept property has one consistent value kind: simple setting, containment relation, or reference relation. Property names must also be unique within a concept. section 2.1
Referencing an attribute in a rental record
An attribute’s initial value can be represented by a separate contained object. When that value is an Attribute Reference, its attribute setting can refer to another Data Attribute, such as using rental price before discount as the initial-value input for rental price after discount. In JavaScript, follow the relation through .ref and verify target identity against the corresponding attribute object. section 2.2 section 3.2.1
References preserve a live connection rather than a copied value: a projection can retrieve a referenced attribute’s name by following settings["attribute"].ref.settings["name"]. Treating every JavaScript object link as deep containment breaks that expectation and can fail on cycles, including a self-reference. section 5.1.6 section 7.4
Persistence must serialize and deserialize reference relations separately from contained objects so an AST can be stored as JSON and transported over HTTP. During observable deserialization, create observable AST objects, record identifiers, and resolve references without recursively converting an already visited target; this also lets MobX preserve reference behavior. section 7.0 section 7.4
