Object-relation diagram (ORD) notation represents one concrete piece of structured data as objects, their simple properties, and relations between them. It makes DSL content’s structure visible before that structure is encoded in code. section 2.0 section 2.1
An object is drawn as a box with a concept label above and zero or more simple settings below. A setting has the form property = value; values may be strings, numbers, Booleans, or enumerated values. A name setting conventionally lets an object be identified by that name. section 2.1
Use ORDs to distinguish the data at hand from a model of permitted data:
- An ORD shows actual objects, the data they hold, and their relations in a particular diagram. section 2.1
- An entity-relationship diagram describes possible entities, data, and relations across a context rather than one particular data instance. section 2.1
- Containment relations organize objects into a tree when reference relations are disregarded; that tree-shaped form is an abstract syntax tree (AST). section 2.3
Extracting a Rental record type
Start with the Rental definition in concrete syntax. Represent the whole definition as a Record Type object, add name = Rental, then create Attribute objects for its four attributes. Connect those attributes through containment relations, add their name and type settings, and represent initial values either as simple values or references. The completed ORD is the definition’s abstract syntax. section 2.2
Extraction reduces concrete syntax to essential information while ignoring notational detail. Visual cues such as keywords, symbols, boxes, arrows, and layout guide the extraction. The reverse direction reconstructs concrete syntax from an AST and underpins a DSL editor visualization. section 2.0 section 2.2
Figure 2.17 The end result of the extraction process
Inspect the completed Rental extraction to see objects, simple settings, containment, and a reference relation together. section 2.2
ORDs remain useful after extraction because they visualize ASTs and algorithms without tying the explanation to a chosen programming language. The notation itself can be viewed as a small DSL for representing structured data. section 3.3.3
