mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-24 10:25:17 +00:00
fbb12b53ba
I did the job and splitted up the readme, hopefully everything was splitted correctly...
19 lines
766 B
Markdown
19 lines
766 B
Markdown
---
|
|
layout: pattern
|
|
title: Mediator
|
|
folder: mediator
|
|
categories: pattern_cat
|
|
tags: pattern_tag
|
|
---
|
|
|
|
**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.
|
|
|
|

|
|
|
|
**Applicability:** Use the Mediator pattern when
|
|
|
|
* a set of objects communicate in well-defined but complex ways. The resulting interdependencies are unstructured and difficult to understand
|
|
* reusing an object is difficult because it refers to and communicates with many other objects
|
|
* a behavior that's distributed between several classes should be customizable without a lot of subclassing |