Proxy: Provide a surrogate or placeholder for another object to control access to it.
Bridge: Decouple an abstraction from its implementation allowing the two to vary independently.
Mediator: 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.
代理这个词很好理解,代理模式在C语言中也很简单,如果接口封装了一个对象的功能,那么这个接口就是一种该对象的代理。
桥接和代理的区别是,代理的中间人是一个对象,代理即对中间人进行操作。而桥接是代理方法,并且不同的对象可指定不同的方法。在C语言中,这两种模式没有区别。
中介者模式,强调的是将对象间的通信转换为中介者的行为,从而实现对象和行为的解耦。
代码:TBD