© Kelt Dockins 2017

Kelt Dockins, Design Patterns in PHP and Laravel, 10.1007/978-1-4842-2451-9_20

20. Mediator

Kelt Dockins

(1)Dolph, Arkansas, USA

$> git checkout mediator$> composer update

Intent

Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.1

Applications

Everyone needs help sometimes. Sometimes you have enough on your plate. The mediator is that guy in the middle who works with you. A few examples of real-world mediators are lawyers, secretaries, and real estate agents. The real estate agent works with the buyer and seller to accomplish the task of changing ownership of a home. ...

Get Design Patterns in PHP and Laravel 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.