O'Reilly logo

Swift 2 Design Patterns by Julien Lange

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

The mediator pattern

The mediator pattern is used to reduce the coupling between classes that communicate with each other.

Roles

This pattern constructs an object, which manages the communication between two or more classes.

These classes don't know each other's implementation. The message is sent from the class to the mediator object.

The mediator pattern defines an object that encapsulates how a set of objects will communicate with each other. Mediator promotes loose coupling by keeping objects from referring to each other explicitly and it also lets you vary their interaction independently.

The mediator is an intermediary used to decouple many peers. This pattern can be used when we want to design reusable components but dependencies between the ...

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