paint-brush
How To Write Decoupled Code with MediatR: The Mediator Patternby@samwalpole
8,527 reads
8,527 reads

How To Write Decoupled Code with MediatR: The Mediator Pattern

by Sam Walpole6mJanuary 9th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow
EN

Too Long; Didn't Read

MediatR is an implementation of the mediator pattern. It is a behavioural software design pattern that helps you to build simpler code by making all components communicate via a "mediator" object, instead of directly with each other. This helps the code to remain highly decoupled and reduces the number of complex dependencies between objects. Using Mediat R, one sends some data as an object to a mediator object. Depending on the type of data that is sent, it decides which other objects/services to call. To send a request, you need to create a request and a request handler.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - How To Write Decoupled Code with MediatR: The Mediator Pattern
Sam Walpole HackerNoon profile picture
Sam Walpole

Sam Walpole

@samwalpole

Fullstack .NET and JavaScript web developer. Coding teacher and advocate

About @samwalpole
LEARN MORE ABOUT @SAMWALPOLE'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Sam Walpole HackerNoon profile picture
Sam Walpole@samwalpole
Fullstack .NET and JavaScript web developer. Coding teacher and advocate

TOPICS

Languages

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite