#readwise # Mediator Pattern - Wikipedia ![rw-book-cover](https://readwise-assets.s3.amazonaws.com/static/images/article0.00998d930354.png) ## Metadata - Author: [[en.wikipedia.org]] - Full Title: Mediator Pattern - Wikipedia - URL: https://en.wikipedia.org/wiki/Mediator_pattern ## Highlights - the mediator pattern defines an object that encapsulates how a set of objects interact. - With the mediator pattern, communication between objects is encapsulated within a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby reducing coupling. - What problems can the Mediator design pattern solve?[2][edit source] Tight coupling between a set of interacting objects should be avoided. It should be possible to change the interaction between a set of objects independently. Defining a set of interacting objects by accessing and updating each other directly is inflexible because it tightly couples the objects to each other and makes it impossible to change the interaction independently from (without having to change) the objects. And it stops the objects from being reusable and makes them hard to test.