General Modeling Question #529
Replies: 1 comment 3 replies
-
Hi @reify-joe-eckard, thanks for your question, and your contribution! Independent deciders can fetch only their own events (by Please check this blog post Deciders are modeling the process(es) in your business. One Decider to model all processes in the RestaurantA single Decider component is producing these events, representing a decision-making algorithm for the whole information system. Pros
Cons
Split to multiple decidersIn more complex situations, we tend to split a single process into multiple processes Now you have two deciders (Restaurant and Order) and a Saga (visualized as a geer on event modeling blueprint) to coordinate them. Please focus on the You have the option to
Unfortunately, we don't have a demo application to demonstrate this. Please refer to the https://fraktalio.com/blog/able-to-be-aggregated.html Pros
Cons
|
Beta Was this translation helpful? Give feedback.
-
Thanks for making this library available, I've enjoyed reading your blog posts. One thing I am struggling with is how to model / implement a decider that needs information from another decider / aggregate to determine if a command is valid.
Is it reasonable to assume that
EventRepository.fetchEvents(c)
can use IDs from the command to fetch events from multiple deciders and combine them into one stream used to build up state for the decider?Expanding on your restaurant example, let's say I wanted to track the preparation of order items as a prescribed series of steps are taken.
(for simplicity's sake let's assume that multiple quantities will start/complete together and ignore failures)
Commands are expected such as
StartStep
&CompleteStep
which contain anorderLineItemId
and astepId
.To determine if a command is valid a decider needs to know:
Does that mean
fetchEvents
could fetch MenuItem step events for the suppliedstepId
as well as OrderLineItem step status events for the suppliedorderLineItemId
and use those to compute a new state that can be used to answer the above questions? (This also assumes that MenuItem step events are produced when creating a restaurant or changing a menu)Also, would these commands ideally be handled by the Order decider, or a new, separate decider - something like OrderLineItemStepDecider?
Or am I completely off and this should be avoided and instead handled by independent deciders & Sagas somehow?
Beta Was this translation helpful? Give feedback.
All reactions