中介者模式(Mediator Pattern) 介绍用一个中介对象来封装一系列的对象交互.中介者使各对象不需要显式地相互引用,从而使其耦合松散,而且可以独立地改变它们之间的交互. 示例有一个Message实体类,某个对象对它的操作有Send()和Insert()方法,现在用一个中介对象来封装这一系列的对象交互. MessageModel using System; using System.Collections.Generic; using System.Text; namespace Pat…
差不多了,睡一觉,下次再弄. <?php /* The more classes we have in our software, the more complex their communication becomes. The mediator pattern addresses this complexity by encapsulating it into a mediator object. Objects no longer communicate directly, but rat…