I'm working on an invoicing web application which uses event sourcing and CQRS.
I have 2 denormalizers for different queries (one for a list of invoice summaries, and one for a single invoice with full details). I find it strange I need to copy a lot of the logic for these 2 denormalizers - for example, listen to events that change the total, subtotal, taxes etc.
I ended up passing the aggregate itself, which contains the real calculated data, on the messaging bus instead of just the events and had the denormalizers listen to it instead of the events.
This made it simpler for me, but seems different from the pattern. This approach was not mentioned in any of the articles I've read.
I liked the idea of passing just the events on the bus and having each denormalizer react to what it needs, but in practice it felt more cumbersome.
I'd love to hear what you think.
Thanks for your help!