Skip to content

Instantly share code, notes, and snippets.

@workze
Created April 24, 2020 07:23
Show Gist options
  • Save workze/c60adc1800bc2853c9528487d26e7ff7 to your computer and use it in GitHub Desktop.
Save workze/c60adc1800bc2853c9528487d26e7ff7 to your computer and use it in GitHub Desktop.
设计模式 中介模式

https://zhuanlan.zhihu.com/p/65931795

问题:不再是单个对象业务逻辑复杂,是对象之间的交互复杂。对象之间相互引用,相互调用。而且交互的逻辑很简单。 解决:引入中介,对象通知中介,中介通知其他相关对象。

注意:使用场景只是:对象之间的交互方法很简单,但是对象之间的引用关系很复杂。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment