An expression is DSL content that evaluates to a value. It can be a constant, a reference to something holding a value, or a computation over other expressions. Because its result is a value, an expression can be nested inside another expression. section 11.0 section 11.6
Expressions capture detailed business logic: calculate values from input or other values, test conditions, and specify outcomes from conditions and calculations. An attribute’s optional initial value is an expression that must produce a value of that attribute’s type. section 11.0 section 1.2.1
Expression concepts provide the building blocks:
- Number produces a literal numeric value. section 8.4.1
- Attribute Reference produces the value held by a referenced attribute. section 8.4.1
- Binary Operation combines left and right operand expressions with one binary operator. section 11.6
Arity—the number of contained subexpressions or operands—is the main characteristic of an expression concept. Concepts with arity greater than zero compose recursively: evaluated subexpressions supply values to larger expressions, allowing a small set of concepts to form arbitrarily large ASTs. section 11.5.2 section 11.6
Most operation-oriented expression concepts have one operator. For a Binary Operation, that operator governs the generated arithmetic expression; binary operators include arithmetic, logical, and comparison operators. Literal values are an obvious exception because they need not operate on subexpressions. section 11.5.3 section 11.6
Computed rental price
A Rental attribute can compute rental price after discount from rental price before discount and discount. The generated runtime represents it as a JavaScript getter, so the property is read-only and the form displays its changing computed value rather than accepting input: `this.rentalPriceBeforeDiscount - this.discount * 0.01 * this.rentalPriceBeforeDiscount`. section 11.3 section 11.0
Figure 11.1 The relation between the values of the four attributes of the Rental record type
Inspect the Rental attribute relationship that motivates an expression for a computed, non-editable price. section 11.0










