Mediator and CQS Patterns
This chapter explores the Mediator design pattern, which plays the role of the middleman between the components of our application.
That leads us to the Command-Query Separation (CQS) pattern, which describes how to divide our logic into commands and queries.
Finally, we consolidate our learning by exploring MediatR, an open source implementation of the Mediator design pattern, and send queries and commands through it to demonstrate how the concepts we have studied so far come to life in real-world application development.
In this chapter, we cover the following topics:
- A high-level overview of Vertical Slice Architecture
- Implementing the Mediator pattern
- Implementing the CQS pattern
- Code smell – Marker Interfaces
- Using MediatR as a mediator
Moreover, this chapter covers the building blocks of the next chapter, which is about Vertical Slice Architecture. Let’s begin with a quick overview...