Closed MateuszNaKodach closed 5 years ago
Hi! Thanks for asking. We modeled it differently just to showcase different modeling techniques. Actually you might say that Book is not an aggregate (does not protect any invariants - it's a downstream event listener).
Yes - it should be handled by someone - at least the hold should be taken off manually - because someone has listened to the BookDuplicateHoldFound event and sent an e-mail. That is thanks to loosely coupled design.
Hello, I've a question for concepts of implementing aggregates in your code. In the readme there is a statement:
And it's nice, but on the other hand Book aggregate looks quite different. The Patron aggregate state is modeled in one class, and the previous conception is easy acceptable in this situation. But the Book aggregate, as I see accepts events, and returns new states (in the future I see here opportunity for event sourcing with small effort). It's also OK, but why those two aggregates are modeled in different manners? And what about compensation process for event BookDuplicateHoldFound - it should be handled by Patron aggregate, shouldn't it? So in this case the Patron aggregate also ought to contains method which accepts event and return new state.