How To Write Decoupled Code with MediatR: The Mediator Patternby@samwalpole
6,572 reads

How To Write Decoupled Code with MediatR: The Mediator Pattern

tldt arrow
EN
Read on Terminal Reader🖨️

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

@samwalpole

Sam Walpole

About @samwalpole
LEARN MORE ABOUT @SAMWALPOLE'S EXPERTISE AND PLACE ON THE INTERNET.
react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa