事件源如何与多种类型的字典对象(如国家/地区、地区、时区等)以及特定域模型中的字典类型相结合预算
或可用性
定义。有些字典对象应该可以在管理 UI 中编辑,但有些则不能。
例如,我们决定不需要国家/地区的管理 UI。因此我们不需要实现AddCountry
/RemoveCountry
命令。
我应该生成一组 CountryAdded
事件,即我应该将字典对象保留为事件流吗? 除了事件流之外,我们是否使用过真实来源?
如果我可以不使用字典对象的事件流,您将如何解决这个问题:
显示具有以下特征的国家/地区列表
每个国家/地区的用户数量。
在这种情况下,我需要在读取模型中表示 Country
对象,并使用 UserAdded
事件的侦听器。
谢谢。
How event sourcing can be combined with several types of dictionary objects like Country
, Region
, Time Zone
etc. and dictionary types from particular domain model like Budget
or Availability
definitions. Some of dictionary objects should be possible to edit in admin UI but some not.
For example we decided, that we do not need admin UI for countries. Thus we do not need to implement AddCountry
/RemoveCountry
commands.
Should i generate set of CountryAdded
events i.e. should i persist dictionary objects as stream of events? Do we ever use source of truth other then event stream?
In case i can go without event stream for dictionary objects, how you'll solve this problem:
Display list of countries with the
number of users in each country.
In this case i need representation of Country
objects in the read model with listener for UserAdded
event.
Thank you.
发布评论
评论(1)
如果使用事件源作为持久化机制,那么:
顺便说一句,我建议将此类问题发布到 DDD/CQRS 群组。它是 CQRS/DDD/ES 问题上最活跃的社区。
If you use event sourcing as the persistence mechanism, then:
BTW I recommend posting questions like these to DDD/CQRS group. It's the most active community on the questions of CQRS/DDD/ES.