DSL structure is the fixed organization that makes domain-specific language content understandable to domain experts and processable by software. It defines concepts, their properties and types, the instances created from those concepts, and the relations represented by property settings. section 1.4.2 section 1.5
A DSL’s structure is built from these elements:
- Concepts provide blueprints for fundamental constructs and have names. section 1.4.2
- Properties belong to concepts, have names and types, and determine what values can be stored. section 1.4.2
- Instances realize concepts in DSL content, while settings assign values to their properties. section 1.5
- Relations connect instances through settings, with property types governing which connections are allowed. section 1.4.2
Car-rental language
A business rule instance uses condition and consequence properties, signaled by “If the” and “then.” A record type instance groups a name and attributes, while an attribute instance defines a name, type, and optional initial value. A record type can hold attribute instances through its attributes property. section 1.4.2
Changing structure means adding, removing, renaming, or retargeting concepts and properties, or refactoring several together. Adding a property or concept widens the accepted AST structure; incompatible changes require AST migration, often implemented as a depth-first traversal. section 10.3.2 section 10.4
Figure 1.20 Zooming in on the structure aspect of a DSL
Use the structural overview to trace how concepts, properties, types, instances, settings, and relations fit together. section 1.4.2
