Skip to manual
gluon

GOL language

Domain

A Domain holds the types of one business area, its glossary and the other domains it may reference.

Model author or developer

Where it goes

Contoso keeps procurement in domains/procurement/domain.yaml. The loader reads every YAML file under the package root, so folders are a convention you can change. Name it in lowercase kebab-case. Files under domains/<name>/ take this domain automatically.

Fields

The keys under spec. Nested shapes follow DomainSpec in the GOL JSON Schema.

FieldPresenceShape
subdomainOptionalenum: core, supporting, generic
colorOptionalcolor
iconOptionalstring
glossaryOptionalarray
contextMapOptionalarray
importsOptionalobject

Syntax and rules

The examples are fragments. Put them in a package next to the resources they reference. A ... stands for a CEL expression you write yourself.

3.2 Domain (bounded context)

GOL · YAML
kind: Domain
metadata: { name: procurement, title: Procurement }
spec:
  subdomain: core # core | supporting | generic
  color: "#7C5CFF" # designer swimlane colour
  icon: file-contract
  glossary: # ubiquitous language; terms resolve in chat before types do
    - term: renewal
      definition: The act of extending a contract beyond its expiry date.
      refersTo: ["Contract#renewalDate", RenewContract]
      synonyms: [extension, verlenging]
  contextMap: # DDD strategic patterns
    - with: party
      relationship: customer-supplier # partnership | shared-kernel | customer-supplier |
      direction: downstream # conformist | anticorruption-layer | open-host | published-language
      via: [party.Organization] # the types this domain is allowed to reference
    - with: finance
      relationship: published-language
      direction: upstream
  imports:
    strict: true # when true, referencing a type not listed in a contextMap `via` is GLN-E204

Check your package

Shell
gluon validate examples/contoso
gluon test examples/contoso

validate reports each problem with a GLN code and its place in the file. test runs the package's Test resources. See the language guide and the diagnostics.

Contoso's procurement Domain in the designer's YAML pane, with its validation status.
Contoso's procurement Domain in the designer's YAML pane, with its validation status.