BlockML Documentation

Value Configuration

Curly braces configure an owned type instance

Curly braces configure the type instance a Property owns — orthogonal to generic parenthesis binding — and the configuration applies to that owned instance, never to the ValueType definition block itself.

Named and positional configuration

Named configuration writes JSON-like key-value pairs inside curly braces, naming each configuration property on the ValueType being configured.

Positional configuration supplies values in the ValueType's own property declaration order instead of naming them, but named and positional forms must never be mixed inside the same curly-brace block.

Configuration is not generic binding

Generic application uses round parentheses to bind a type parameter to a concrete type, while curly braces configure the resulting instance — the two are orthogonal and may appear together on the same type reference.

Configuring a Text property's length

A Text property can bound its own length using named curly-brace configuration directly on its type, rather than a separate Constraint.

<!-- "caption" bounds its own length with named curly-brace configuration -->
<acme:Label xmlns="http://blockml.org/bml"
  xmlns:acme="com.acme.example"
  xmlns:core="org.blockml.bml.core"
  xmlns:type="org.blockml.bml.type">

  <baseType>
    core:Block
  </baseType>
  <properties>
    <caption type="type:Text{maxLength: 40}" />
  </properties>
</acme:Label>

The maxLength: 40 bound belongs entirely to caption's own type instance — the Text ValueType definition itself remains unaffected, and other Text properties elsewhere may configure a different bound, such as maxLength: 100, or none at all.

What to carry into the next pages

After this page, readers should be able to write curly-brace configuration on a Property's type reference, closing out the behaviour-and-values group before Composition shows how aggregations get filled with actual children.

Continue with composition