2

In the DDD Sample, Cargo Tracking application, there are "ApplicationEvents" and DomainEvents.

ApplicationEvents examples: "cargoHasArrived", "cargoWasMishandled"

DomainEvent example: "HandlingEvent.LOAD", "HandlingEvent.RECEIVE", "HandlingEvent.UNLOAD",etc.

How are application and domain events supposed to be different semantically and what are some guidelines you use to determine if it goes in ApplicationEvent or DomainEvent?

Jason
  • 2,006
  • 3
  • 21
  • 36
  • I believe "cargoHasArrived" and "cargoWasMishandled" are Domain Events actually. The ApplicationEvents is just a technical approach of publishing domain events. – Yugang Zhou Jul 06 '15 at 15:35
  • 1
    In the DDD sample, "cargoHasArrived" and "cargoWasMishandled" are published in an Application Service, not in the domain model or a Domain Service. Also, they do not implement the DomainEvent interface. This makes it unclear about what they are and raises questions about guidelines on when something is an ApplicationEvent vs. when it is a DomainEvent. – Jason Jul 06 '15 at 15:44
  • Yes, I understand. But I think that's because domain events and the publishing approach it entails was not explicit at the time the sample was written. – Yugang Zhou Jul 07 '15 at 03:12

1 Answers1

4

Application Events are characteristic to the specific Use Case/User Story. They model application (not domain) behavior.

Technically Domain Events are the same. Difference is on the mental level - Domain Events model facts that takes place in domain model.

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

Community
  • 1
  • 1
Martin4ndersen
  • 2,806
  • 1
  • 23
  • 32