In command handlers should data be grabbed from aggregates via repos or view/read model

Hi, I’m trying to determine the best approach for handling this situation. Say I’m sending a command to Aggregate A, and the handling of that command I need to check something or grab some data from an instance of aggregate B. Is it ‘preferable’ to look directly at the instance Aggregate B, or it’s projection on the view/read model?

Hi Erich,

As aggregates have no “get” methods, you cannot do that. Just query the view model for this.

Cheers,
Michael

Well I’m actually using Scala, so I’m getting them for free by default :wink: But I will look to use the read side in this scenario

I don’t know what exactly Aggregate A needs from Aggregate B in your case but this might as well be an indicator that your aggregate boundaries could be improved.