CommandMessage
Represents a command message that can be sent to an aggregate. This interface extends several other interfaces to provide a comprehensive set of properties and methods for handling commands within a domain-driven design (DDD) context.
The CommandMessage
interface ensures that each command has a unique identifier, is associated with an aggregate, and can be copied. It also provides properties to manage the state and behavior of the command, such as whether it is a create command or if it allows the creation of a new aggregate.
Parameters
the type of the command payload
Properties
Represents the unique identifier of the aggregate to which this command message is directed. This property is essential for identifying the specific aggregate that the command should be applied to, ensuring that commands are correctly routed and processed within the system.
aggregate name.
Represents the version of the aggregate. This value is used to ensure that commands are applied to the correct version of an aggregate, which is essential for maintaining consistency and preventing conflicts in concurrent environments. A null
value indicates that the version is not specified or relevant.
Indicates whether the creation of a new aggregate is allowed by this command. This property is useful in scenarios where certain commands should only be applied to existing aggregates or when there are specific conditions under which an aggregate can be created.
Represents a unique identifier for a command. This identifier is crucial for ensuring that each command can be uniquely identified, which is particularly useful in scenarios where idempotency of commands needs to be guaranteed or when tracking and correlating commands across system boundaries.
Represents a unique identifier for a request. This identifier is crucial for ensuring that each request can be uniquely identified, which is particularly useful in scenarios where idempotency of requests needs to be guaranteed or when tracking and correlating requests across system boundaries.