MediatR is a popular library in .NET used to decouple components. In Clean Architecture we aim to keep the core of the application as independent as possible from such “details” like third-party libraries and frameworks.
Nevertheless, I have recently read quite some articles and watched some great videos about using MediatR in Clean Architecture based projects.
But doesn’t the usage of MediatR in Clean Architecture break the Dependency Rule?
Article "Implementing Clean Architecture - To use or not to use MediatR?":
http://www.plainionist.net/Implementi...
Source code used in this tutorial:
https://github.com/plainionist/AboutC...
Simple event bus:
• Interfaces SIMPLY WON'T Do the Trick!
Dynamic decorators:
http://www.plainionist.net/DynamicProxy/
0:00 Intro
0:18 Example 1
1:18 Example 1
2:13 So what?
2:43 Adapter pattern
15:08 Design alternatives
18:51 Conclusion
CREDITS:
"Subscribe Button" by MrNumber112 • Free Download: Subscribe Button + Not...
Adapter approach inspired by the answer from "Dawood Moazzem" to this stackoverflow.com question:
https://stackoverflow.com/questions/4...
Definition of "pragmatic":
https://www.oxfordlearnersdictionarie...
Watch video How to NOT Marry MediatR in Clean Architecture online without registration, duration hours minute second in high quality. This video was added by user About Clean Code 24 January 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 5,737 once and liked it 115 people.