How to NOT Marry MediatR in Clean Architecture

Опубликовано: 24 Январь 2023
на канале: About Clean Code
5,737
115

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...


Смотрите видео How to NOT Marry MediatR in Clean Architecture онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь About Clean Code 24 Январь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 5,737 раз и оно понравилось 115 людям.