ドメインイベントとは?
ドメインイベントとは、OrderPlacedやPaymentCapturedのように、ドメインで重要な変化が起きたことを捉える不変の事実です。すでに起きたことを記述するため、過去形で命名されます。システムの他の部分は、発生元のコードに直接結合することなく反応するために、これらのイベントを購読します。
なぜ重要か
ドメインイベントは、変更を行う部分と、それに反応する部分を疎結合にします。監査ログ、連携、結果整合性を持つワークフローのための自然な継ぎ目を与えます。
関連ガイド
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…