2

在 DDD Sample, Cargo Tracking 应用程序中,有“ApplicationEvents”和 DomainEvents。

ApplicationEvents 示例:“cargoHasArrived”、“cargoWasMishandled”

DomainEvent 示例:“HandlingEvent.LOAD”、“HandlingEvent.RECEIVE”、“HandlingEvent.UNLOAD”等。

应用程序和域事件在语义上应该如何不同,您使用哪些准则来确定它是进入 ApplicationEvent 还是 DomainEvent?

4

1 回答 1

4

应用程序事件是特定用例/用户故事的特征。他们对应用程序(而不是域)行为进行建模。

从技术上讲,领域事件是相同的。差异在于心理层面 - 领域事件模型事实发生在领域模型中。

https://code.google.com/p/ddd-cqrs-sample/wiki/DomainDrivenDesignBusinessDeveloperMentalModel

于 2015-07-06T18:42:13.967 回答