Note that there are some explanatory texts on larger screens.

plurals
  1. POCQRS - allowed dependencies for building read model using events and other sources of information
    primarykey
    data
    text
    <p>My question is related to CQRS (Command and Query Responsibility Segregation) and mechanism that builds read model (views). As far as I understand read model is built by event handlers. These handlers (also called denormalizers) receive domain events and use these events to build different views of data.</p> <p>Specific event carries information about change done in domain model. I think that this information is not sufficient in some cases to build view - i.e. not changed fields, not changed entities are missing in such event etc. </p> <p>So my question is:</p> <p>Is it allowed that denormalizer responsible for building read model accesses not only events but also:</p> <ol> <li>changed entity referenced directly in event?</li> <li>changed aggregated root and any entity related to this aggregate?</li> <li>any entity fetched from repository?</li> <li>any view?</li> </ol> <p>What is your opinion about allowed dependencies for event handlers (denormalizers)? </p> <p>edit: Just added simple example to the question above:</p> <p>Suppose the following model:</p> <p>AR: ProductOffering * name * description * category * price</p> <p>AR: Customer * name * type * method: purchaseProduct(productOffering) that emits ProductPurchasedByCustomer event</p> <p>entity: ProductInstance * customer * productOffering</p> <p>event: ProductPurchasedByCustomer * customerId * productOfferingId</p> <p>view: ProductInventoryView * customerId * productOfferingId * customerType * productOfferingName * productOfferingCategory * price</p> <p>How to build ProductInventoryView using only ProductPurchasedByCustomer event? How can I write denormalizer to put into view information about customerType, productOfferingName etc? Should I lookup additional information about customerType and productOfferingName from different views? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload