A setting assigns a value to a property on an instance of a concept. Settings give DSL content its concrete data and can also represent relations between instances. section 1.4.2 section 1.5
When an abstract syntax tree is encoded as JavaScript, settings follow these forms:
- Store settings as key-value pairs in an AST object's settings subobject. section 3.4
- Encode multivalued settings as arrays and navigate containment relations through their values. section 3.2.1 section 3.4
- Encode reference relations as objects whose ref property points to the target AST object. section 3.2.1 section 3.4
Reading and changing settings
For a rental record type, rental.settings["name"] reads the name setting, while rental.settings["attributes"][3] selects its fourth attribute. Updating rental.settings["attributes"][2].settings["initial value"].settings["value"] to 10 changes a nested setting. section 3.2.1
Figure 1.20 Zooming in on the structure aspect of a DSL
Use the structure diagram to connect concepts, properties, instances, and settings. section 1.4.2
