CommandMessage
interface CommandMessage<C : Any> : NamedMessage<CommandMessage<C>, C> , AggregateIdCapable, NamedAggregate, OwnerId, SpaceIdCapable, CommandId, RequestId, Copyable<CommandMessage<C>>
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:
Aggregate targeting via AggregateIdCapable and NamedAggregate
Message structure via NamedMessage
Ownership context via OwnerId
Copy capability for immutability patterns
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...
}Content copied to clipboard