liveBook · Manning

Runtime

As explained in Building User-Friendly DSLs

The complete desired business software system produced for domain stakeholders, distinct from a low-level execution environment such as the runtime of a programming language.

A Runtime is the complete business software system desired by domain stakeholders. It is not a programming-language execution environment such as the JVM, .NET, or Node.js; those operate near the OS rather than representing domain-specific business software. A car-rental Runtime can include both the customer application for arranging rentals and employee point-of-sale systems for carrying out business processes. section 1.2

In a DSL-based approach, domain experts author precise DSL content in a Domain IDE. Its build system generates and builds much of the Runtime automatically, while developers implement the parts that cannot be specified in the DSL, plus build, deployment, and runtime configuration. The resulting behavior gives the DSL content its meaning. section 1.5 section 8.0

A Runtime codebase combines three kinds of work:

  • Generated code corresponding directly to business knowledge captured as DSL content. section 8.0
  • Handwritten code that integrates with generated code but cannot be expressed in the DSL. section 8.0
  • Build configuration required to build, run, or deploy the Runtime artifact. section 8.0

Rental Runtime

A reference Runtime can be a React web app with a form for one Rental record. Its fields represent rental period, price before discount, discount, and price after discount; DSL amount and percentage values map to JavaScript Number values, while a date range uses a DateRange class. Business rules can replace an editable discount field with a computed display value. section 8.3 section 14.2.4

Figure 8.2 The organization of the Runtime’s codebase
figure

Shows the split between business-knowledge code, supporting handwritten code, and build configuration in a Runtime codebase. section 8.0

How Building User-Friendly DSLs covers it

How deep it goes
Explains codebase responsibilities and implements a React reference Runtime, while deliberately deferring a fully developed Runtime.
Examples
Demonstrates a car-rental React form and changes its discount from user input to business-rule computation.
What it assumes
Introduces the Runtime through a car-rental domain example without assuming advanced DSL or compiler knowledge.
What you can do after
Build it from scratch as a simple React Runtime and separate generated business code from handwritten supporting code.
How it connects
Connects Runtime to Domain IDE, DSL content, code generation, build system, business rules, and record types.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building User-Friendly DSLs. The section links point to the parts of the book it draws on.