Re: Re: CQS
2009-02-01 01:43:33 GMT
> > Does the aggregate root fire a message when it's done adding/ > processing an order, which the reporting context subscribes to? > > It’s actually the bounded context, but yes. More specifically, the > service layer which processed the message by calling a method on the > aggregate root would do the publishing. This raises an interesting question - I thought if you were using Event Sourcing, then the Aggregate Roots would be processing the events as well. ie, That you'd have an MyAggregateRoot.ProcessOrder(ProcessOrderEvent) method or something similar - and then this would apply whatever state changes were necessary on the domain objects and fire some sort of completed event. In Fowler's Event Sourcing patterns, he prefers the processing logic on the Events themselves where possible. This certainly makes a lot of sense for the reasons he elicits, but in a DDD context, does that then lead to anaemic domain objects as most of the logic is contained in the Events themselves? If the domain objects became the event processors instead, then you'd have more of the state changing logic encapsulated on the domain objects themselves - but you'd also run into the issue that your domain objects are now event-aware, and is this something that they should "know" about? Perhaps the answer to this depends on whether "Events" are a part of your Ubiquitous Language in your domain or not. This could probably be argued back and forth a lot - as one could probably equally have the same argument over explicit methods (are "Methods" part of your Ubiquitous Langauge?) Whether your domain objects are processing event objects or more fundamental types as(Continue reading)
RSS Feed