CommandMessage

Represents a complete command message that encapsulates a command to be executed against an aggregate in the Wow framework.

This interface combines multiple concerns for command handling in a domain-driven design (DDD) context:

Command messages are the primary mechanism for initiating state changes in aggregates, supporting both creation and modification operations with proper versioning and idempotency guarantees.

Type Parameters

C

The type of the command payload, which contains the specific data for the operation

See also

for command uniqueness

for aggregate targeting

for message structure

Example usage:

data class CreateOrderCommand(
val customerId: String,
val items: List<OrderItem>
) : CommandMessage<CreateOrderCommand> {
// Implement required properties...
}

Properties

Link copied to clipboard
abstract override val aggregateId: AggregateId

The target aggregate identifier for this command.

Link copied to clipboard
abstract val aggregateVersion: Int?

The expected version of the target aggregate for optimistic concurrency control.

Link copied to clipboard
abstract val allowCreate: Boolean

Indicates whether this command permits the creation of a new aggregate if one doesn't exist.

Link copied to clipboard
open override val commandId: String

Unique identifier for this command instance, delegated from the message ID.

Link copied to clipboard
abstract val isCreate: Boolean

Indicates whether this command is intended to create a new aggregate instance.

Link copied to clipboard
abstract val isVoid: Boolean

Indicates whether this command is a void command that doesn't expect a response.