liveBook · Manning

Attribute

As explained in Building User-Friendly DSLs

A named characteristic of a language concept whose type determines the kind of value or relation it can hold.

An attribute is a named characteristic represented within a domain-specific language (DSL). Its type determines what value the attribute can hold and how it can relate to other instances. section 1.4.2

An attribute instance can define:

A record type can hold attribute instances through its attributes property. Settings on instances assign values, while property types govern relationships between instances and constrain the DSL structure. section 1.4.2 section 1.5

Renaming an attribute property

A structure migration can rename the Data Attribute concept to Attribute and move settings from initial value to value, deleting the old setting while traversing the AST. section 10.3.2

How Building User-Friendly DSLs covers it

How deep it goes
Specifies names, types, optional initial values, relations, and structural migrations, but stops short of implementation details for defining attributes.
Examples
Uses car-rental record types and a Data Attribute migration that renames initial value to value.
What it assumes
Assumes basic familiarity with DSL concepts and instances while teaching attribute names, types, values, and relations directly.
What you can do after
Apply typed attributes to model DSL data and diagnose structural changes requiring AST migration.
How it connects
Connects concepts, properties, types, instances, settings, record types, abstract syntax trees, and AST migrations.

Also explained in

Compare how 26 books explain attribute →

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.