domain driven design - In CQRS, how do I communicate a list of allowable methods on an aggrregate to the UI? -
I have a total root order, and there are several ways in it that are set internally to my 'status' field
Available actions are dependent on the order's order (as if it can already be placed on hold) The problem is that I want to provide a query to tell the UI Required commands are available, so I can hide the actions that could otherwise throw How can I do this with a minimum DRY violation? Simple Solution Example: This is definitely one of the options do not expect that there will be no duplication. The CQRS helps in managing complexity and sometimes it means that there is a slight breach of dryness. InvalidOperationException
PlaceOnHoldCommand Result < To read the current situation with the available changes to display in Code> OrderPlacedOnHoldEvent / read the query model and select it. In addition to being placed in ( eventstore ), it is published and controlled by
OrderTransitionsEventHandler , which denormalizes changes available in a DB table associated with the order. The customer selects available changes and works accordingly (hides unavailable buttons or such.)
Comments
Post a Comment