Suppose a model with Customer as AggregateRoot.
A customer can register an Order, hence you get a series of order
related events (created, updated, deleted)
An order contains multiple Orderlines, hence you get a similar serie
of orderline related events.
The OrderCreatedEvent triggers an addition of the order to a
collection of orders. This event is clearly handled inside the
Customer AggregateRoot.
However, for orderlines I find this unsettling. It doesn't seem right
to me, to handle orderlines event inside the customer class which
doesn't know anything about offerlines.
Would you make Order an Aggregate which would be able to handle the
offerline events? If so, how do you filter the right order to handle
the offerline events?
Please share your thoughts
regards
Roald