There has been much confusion of late over the definition of what a Domain Event is. I was writing some stuff that will go into both the course manual and the book and figured that it might be timely to put it up on the blog as well.
An event is something that has happened in the past.
All events should be represented as verbs in the past tense such as CustomerRelocated, CargoShipped, or InventoryLossageRecorded.
在greg的帖子后面有长篇和其他人关于domainevent的争论. 其中他有这么一段话 "In many cases you will actually end up with a pair of objects, the first a SOM style “Transaction Object” in the domain the second a “Domain Event” that the domain publishes to anyone subscribing to it. The second concept is a “Notification of an Occurence” not a modeling of the occurrence. I will make this point clearer in my original text. This goes to Nuno’s comment as well though I put up a comment on the DDD list. Its not that the Domain Event replaces the SOM transaction object, they are different things with different goals." 我对他的理解是 真正的DDD中的domainevent是统一语言的一部分, 就是为了起到通知发生了什么的作用. 这里引入了SOM, 我是觉得这个SOM transaction object 是banq您所指的"发生在两个对象以上的交互称为事件", 所以我一直困惑到底什么是DDD书中说的domainevent. 目前我更倾向于greg的看法, 他们是两个为了不同目的不同的概念.