Chapter 6 - The aggregate could cause unnecessary complexity
continues from Chapter 5 - Event sourced aggregates are hard to refactor ...... Let's add a little more spice to our example, introducing rule number 4: A course cannot accept more than N students N, the Course Capacity, can change at any time to any positive integer different from the current one (even if the number of currently subscribed students is larger than the new value) The course title can change at any time to any title different from the current one The student cannot join more than 10 courses Back to the board! We need a new event for the creation of the student, and the relative command. But here, things get complicated, since we need a new event for the subscription and a new event for the unsubscription. Both triggered by their respective commands. Déjà -vu? Yes, because we have already met very similar events and commands when we were talking about the course. But now we need two more pairs, because the newly introduced rule is relative to a ne...