Summary

In this chapter, we looked at how the intent of our users can be represented as commands that those users send to our system. We learned about how these commands can be handled and looked through several examples of the command handler pattern and then got to the application service.

We looked at the API versioning although it is not directly related to the book topic, such practice is extremely useful for leaving it out. This will be useful also when we get to the event versioning as soon as we get closer to event-sourcing.

Our application service grew throughout the chapter, and we used one of the latest features of C#, a gift from the functional world, called Advanced Pattern Matching. We used this feature to simplify the application service interface, which ended up having just a single method. By doing this, we also enabled using a composition, yet another functional-style approach, to chain command handling with operational concerns like logging and retries. Later, we will also look how this can help us checking the validity of commands.

In the next chapter, we will look closer to the entity persistence and the scope of it will be our focus. We will learn what types of consistency we need to be dealing with and how important it is to understand the consistency boundaries.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.103.204