NameRules

The naming rules of a model, one definition the compiler, the kernel's model DSL and the Kotlin contract generator all ask, so that none accepts a name another cannot use; the TypeScript generator's copy (typescript/wow-generator/src/manifest/nameRules.ts) is held equal to it by the cases of typescript/wow-generator/test/fixtures/name-rules.json, which a test of each reads.

  • A name (NAME_PATTERN) is an aggregate's, a command's, an event's, a processor's or a handler's, written with @Name or taken from the class or the function: a letter, then letters, digits, _ and -. A dot is never part of one, since it joins the names (context.aggregate.Command, processor.handler).

  • A code (CODE_PATTERN) is a rejection code (@ErrorCode): segments joined by dots, each a letter or a digit, then letters, digits, _ and -; a local code is one segment.

  • A framework name (FRAMEWORK_NAME_PATTERN) is one of Wow's own, which no domain declares: wow, then names after dots (wow.lifecycle.DeleteAggregate, wow.snapshot).

The rules are ASCII, and narrower than "an identifier can be taken from it": a name is also a segment of a topic (wow.<context>.<aggregate>.state), of a URL path and of a Wow-Wait hop, which take nothing else, so widening a rule to what Kotlin or TypeScript reads as an identifier would admit names those cannot carry.

Properties

Link copied to clipboard
const val CODE_PATTERN: String

What a code matches: its segments, joined by dots.

Link copied to clipboard

What a segment of a code matches.

Link copied to clipboard

What a name of the framework's own matches.

Link copied to clipboard
const val NAME_PATTERN: String

What a name matches.

Functions

Link copied to clipboard

Why code is no code, as what follows its subject in a sentence (<subject> is not a code: …, without a full stop), naming the segment at fault; null when it is one.

Link copied to clipboard
fun isCode(code: String): Boolean

Whether code is a code.

Link copied to clipboard

Whether name is a name of the framework's own.

Link copied to clipboard
fun isName(name: String): Boolean

Whether name is a name.

Link copied to clipboard

Why name is no name, as what follows its subject in a sentence (<subject> is not a name: …, without a full stop); null when it is one.