API styles
If you recall from Chapter 5, Implementing Domain Logic, we created the following commands:
Figure 6.1 – Commands from the eventstorming session
If you observe carefully, there seem to be commands at two levels of granularity. Create LC Application and Update LC Application are coarse-grained, whereas the others are a lot more focused in terms of their intent. One possible decomposition of the coarse-grained commands can be as depicted here:
Figure 6.2 – Decomposed commands
In addition to just being more fine-grained than the commands in the previous iteration, the revised commands seem to better capture the user’s intent. This may feel like a minor change in semantics, but can have a huge impact on the way our solution is used by its ultimate end users. The question then is whether we should always prefer fine-grained APIs over coarse-grained ones. The answer can be a lot more nuanced. When designing...