---
title: "中介者模式"
author: "nully"
date: "2016-02-02T19:57:40Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2016-02-02T19:59:38Z"
id: 2275541
url: "https://nully.iteye.com/blog/2275541"
---

中介者模式是指用一个中介对象来封装一系列对象的交互，中介者对象使对象间不需要显示引用，使其达到松耦合。


![](http://dl2.iteye.com/upload/attachment/0114/9665/308ed0aa-daa7-39e2-ba2c-f291dd851d61.jpg)

![](http://dl2.iteye.com/upload/attachment/0114/9668/87f6fdd8-4b36-320c-a2a6-914d660f9ce5.jpg)


结构图：

![](http://dl2.iteye.com/upload/attachment/0114/9670/179d65da-5f09-3768-a24f-26e344ed4237.jpg)


适用场景：

1.多个对象之间相互关联交互，形成类似网状结构