© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
D. NesterukDesign Patterns in .NET 6https://doi.org/10.1007/978-1-4842-8245-8_19

19. Mediator

Dmitri Nesteruk1  
St. Petersburg, c.St-Petersburg, Russia

A large proportion of the code we write has different components (classes) communicating with one another through direct references. However, there are situations where you don’t want objects to be aware of each other’s presence. Or perhaps you do want them to be aware of one another, but you still don’t want them to communicate through references, because as soon as you keep and hold a reference to an object, you extend that object’s lifetime beyond what might originally be desired (unless you use a

Get Design Patterns in .NET 6: Reusable Approaches in C# and F# for Object-Oriented Software Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.