Category: Implementing the Mediator patternPage 1 of 2

Project organization – Getting Started with Vertical Slice Architecture

Here is how we organized the project:  Figure 17.4: Solution Explorer view of the file organization  In this project, we support request validation using FluentValidation, a third-party NuGet…

Downside or Upsides? – Getting Started with Vertical Slice Architecture

The following points are downsides that we can tame as upsides: A way to start refactoring that business logic would be to push the logic into the domain…

Using MediatR as a mediator – Mediator and CQRS Design Patterns-2

As you may have noticed in the code, I chose the same pattern to build the commands as I did with the CQS sample, so we have a…

Using MediatR as a mediator – Mediator and CQRS Design Patterns-1

In this section, we are exploring MediatR, an open-source mediator implementation.What is MediatR? Let’s start with its maker’s description from its GitHub repository, which brands it as this:…

Dependency identifier – Mediator and CQRS Design Patterns

If you need markers to inject some specific dependency in a particular class, you are most likely cheating the Inversion of Control principle. Instead, you should find a…

Conclusion – Mediator and CQRS Design Patterns

The CQS and CQRS patterns suggest dividing the operations of a program into commands and queries. A command mutates data, and a query fetches data. We can apply…

Project – CQS – Mediator and CQRS Design Patterns-1

Context: We need to build an improved version of our chat system. The old system worked so well that we need to scale it up. The mediator was…

Conclusion – Mediator and CQRS Design Patterns

As we explored in the two preceding projects, a mediator allows us to decouple the components of our system. The mediator is the middleman between colleagues, and it…

Project – Mediator (IChatRoom) – Mediator and CQRS Design Patterns-2

The ChatRoom class is slimmer than the User class. It allows participants to join and sends chat messages to registered participants. When joining a ChatRoom, it keeps a…

Project – Mediator (IChatRoom) – Mediator and CQRS Design Patterns-1

In the previous code sample, we named the classes after the Mediator pattern actors, as shown in Figure 14.7. While this example is very similar, it uses domain-specific…