O'Reilly logo

Design Patterns in Modern C++: Reusable Approaches for Object-Oriented Software Design by Dmitri Nesteruk

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

© Dmitri Nesteruk 2018

Dmitri Nesteruk, Design Patterns in Modern C++, https://doi.org/10.1007/978-1-4842-3603-1_17

17. Mediator

Dmitri Nesteruk

(1)St. Petersburg, Russia

A large proportion of the code we write has different components (classes) communicating with one another through direct references or pointers. However, there are situations when you don’t want objects to be necessarily 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 pointers or references because, well, those can go stale and you don’t want to dereference a nullptr, do you?

So the Mediator is a mechanism for facilitating communication between the components. Naturally, the mediator itself ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required