O Que É um Domain Event?
Um domain event é um fato imutável que captura que uma mudança significativa ocorreu no domínio, como OrderPlaced ou PaymentCaptured. É nomeado no passado porque descreve algo que já aconteceu. Outras partes do sistema assinam esses eventos para reagir sem estarem diretamente acopladas ao código de origem.
Por que importa
Domain events desacoplam a parte que faz uma mudança das partes que reagem a ela. Eles oferecem uma costura natural para logs de auditoria, integrações e fluxos de trabalho eventualmente consistentes.
Guias relacionados
What Is an Aggregate Root?An aggregate root is the single entity through which all access to a cluster of related domain objects flows,…
What Is Event Sourcing?Event sourcing stores state as an append-only log of events rather than current values, rebuilding state by r…
What Is a Command Handler?A command handler is the component that receives a command requesting a change, validates it, and executes th…