MATHEMATICS, COMPUTER SCIENCE AND EDUCATION
“ST. CYRIL AND ST. METHODIUS” UNIVERSITY OF VELIKO TARNOVO - UNIVERSITY PRESS

Implementation of the software design patterns mediator and CQRS with the library mediatr in .NET


Authors:
Plamenna Petrova St. Cyril and St. Methodius University of Veliko Tarnovo, Bulgaria
Zlatko Varbanov St. Cyril and St. Methodius University of Veliko Tarnovo

Pages: 75-82
DOI: https://doi.org/10.54664/URDG9808

Abstract:

This paper explores the features of the popular open-source library from the .NET ecosystem MediatR, which implements the behavioral software design pattern Mediator to achieve loose coupling and better communication between the components of developed applications. It introduces an ‘in-process’ mediator, which aids in building systems, based on the Command and Query Responsibility Segregation software design pattern (CQRS). The MediatR library offers the ability to handle both synchronous and asynchronous requests, responses, commands, notifications, and events. It provides a straightforward approach for managing command and request handlers, simplifying the adoption of CQRS. Using the MediatR library improves the modularity and testability of .NET applications by promoting adherence to SOLID principles in the code structure. This facilitates complex interactions between different parts of applications, the integration of new functionalities and the maintenance of existing ones.

Keywords:

Software Design Patterns, GoF, Mediator, Command and Query Responsibility Segregation (CQRS), MediatR, .NET, C#, API, SOLID principles, Domain-driven Design (DDD), Clean Architecture, Separation of concerns.

Download


83 downloads since 9.12.2024 г.
NA
  • © ST. CYRIL AND ST. METHODIUS UNIVERSITY OF VELIKO TARNOVO 2016 - 2025