← Graph

Command Handler

concept 3 connections

Component that receives a command message, projects the relevant entity, accepts or rejects the command (usually via an if/else whose branches determine which event to write — e.g. 'withdrawn' vs 'withdrawal declined'), and writes the event to the event store. The handler, not the entity, owns the messaging concern of interpreting command attributes and deciding which event to emit. Ladd argues the handler must control its own projection, its own writer (to apply concurrency protection like expected-version selectively), and its own idempotence; substitute writers let tests exercise handlers without touching the database.

category
pattern
about
Command Handler concept
Describes MVC controllers as command handlers and argues handlers must own projection and writing.
about
Command Handler concept
Answer argues the decision belongs in the handler, not the entity.
about
Command Handler concept
Handlers dispatch messages by type and publish resulting events.

Provenance

Read by
7 extractions