September 2023
Intermediate to advanced
470 pages
11h 12m
English
As we conclude this chapter, let’s review the design decisions we made, starting with naming.
Our code shows that the AddToDoItem command generates an event named ItemAdded, and the CreateToDoList command generates an event named ListCreated. This practice of matching command and event names is a widespread pattern. However, it’s not always applicable—it may be that what appears to be a single event is actually a more intricate business scenario. Hence, it’s advisable not to blindly adopt this pattern.
In general, commands are linked to the external API and the use-cases, while events reflect the strict logic of the finite state machine. A good rule of thumb is to be generous with events and define many ...
Read now
Unlock full access