liveBook · Manning

Concept

As explained in Building User-Friendly DSLs

A blueprint for a fundamental DSL construct that can be instantiated and given properties.

A concept is a blueprint for a fundamental construct in a domain-specific language (DSL). It has a name and properties; each property has a name and a type, and the type determines which values it can hold. section 1.4.2

A DSL author instantiates concepts to create DSL content. Each instance assigns property values through settings. Settings can also represent relations between instances, subject to the types of their properties. section 1.4.2 section 1.5

A car-rental DSL uses concepts to organize domain data:

  • A business rule concept has condition and consequence properties. section 1.4.2
  • A record type concept has name and attributes properties, grouping related data. section 1.4.2
  • An attribute concept has name, type, and optional initial value properties. section 1.4.2

Changing a concept

Changing a DSL may add a property or concept, alter a property type, remove or rename an element, or refactor several concepts together. Non-widening changes require AST migration so existing content conforms to the new structure. section 10.3.2

Figure 1.20 Zooming in on the structure aspect of a DSL
figure

Use the structural overview to trace how concepts, properties, instances, settings, and relations fit together. section 1.4.2

How Building User-Friendly DSLs covers it

How deep it goes
Explains blueprints, typed properties, instances, settings, and relations, while deferring complete content representation to later treatment.
Examples
Uses business rule, record type, and attribute concepts from a car-rental DSL, then demonstrates a renamed property and concept.
What it assumes
Assumes familiarity with DSL content at a basic level while defining concepts, properties, types, instances, and settings directly.
What you can do after
Evaluate DSL structure by identifying concepts, their typed properties, their instances, and their inter-instance relations.
How it connects
Connects concepts to properties, instances, settings, relations, constraints, ASTs, and code generation.

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.