Skip to content
Chris Harrison edited this page Jun 20, 2020 · 2 revisions

VOML

VOML stands for Value Object Markup Language.

Scalar values

You can define a simple scalar value object. The type and the name of the value object should be defined on the same line. It is a convention that VO types are in lowercase and VO names are in camel case.

integer NumberOfStarships
string StarshipName
boolean IsStarshipStarfleet

Value objects with values

You can define a value object as having a set of values.

enum StarshipClass {
    GALAXY
    INTREPID
    DEFIANT
    CONSTITUTION
}

Value objects with properties

You can define a value object as having a set of properties, which are themselves value objects.

composite Starship {
    id: StarshipId!
    name: StarshipName!
    registry: StarshipRegistry!
    captain: Captain!
    firstOfficer: FirstOfficer
}

The exclamation mark (!) marks the property as required.

Value objects that hold other value objects

You can define a value object as holding another type of value object.

set SetOfIntegers[AnIntegerVO]

Additional arbitrary configuration

A value object definition can be marked up as having additional configuration. These are simple key/value pairs separated by spaces.

A value object itself can have configuration:

composite Message (messageType: event) {
    ...
}

The properties of a value object can have configuration:

composite Starship {
    property: Property (key1: value1 key2: value2)
}

Clone this wiki locally