CommandAggregate
interface CommandAggregate<C : Any, S : Any> : NamedTypedAggregate<C> , AggregateProcessor<C> , Version
Represents a command aggregate that processes commands and manages state transitions.
A command aggregate subscribes to command messages, validates business rules using the current state from the state aggregate, and publishes domain events. It coordinates between command processing and state management.
Key responsibilities:
Subscribe to command messages
Validate business rules using state aggregate's current state
Publish domain events
Type Parameters
C
The type of the command aggregate root.
S
The type of the state aggregate. The state contains the current aggregate state, commandRoot is the command aggregate root, and commandState tracks the current command-processing state.