上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 19 下一页
摘要: Intent (定义) Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving 阅读全文
posted @ 2022-06-10 17:31 伟衙内 阅读(17) 评论(0) 推荐(0) 编辑
摘要: Intent (定义) Provide a surrogate or placeholder for another object to control access to it.(为另一个对象提供代理或占位符,以控制对它的访问。) Also Known As (别名) Surrogate Moti 阅读全文
posted @ 2022-06-10 10:51 伟衙内 阅读(21) 评论(0) 推荐(0) 编辑
摘要: Intent (定义) Use sharing to support large numbers of fine-grained objects efficiently(使用共享可以有效地支持大量的细粒度对象。) Motivation (详细说明) 如下图所示,这是一个文档编辑器,有字符对象,列对象 阅读全文
posted @ 2022-05-24 15:36 伟衙内 阅读(28) 评论(0) 推荐(0) 编辑
摘要: Intent (定义) Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier 阅读全文
posted @ 2022-05-24 10:47 伟衙内 阅读(30) 评论(0) 推荐(0) 编辑
摘要: Intent (定义) Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functi 阅读全文
posted @ 2022-05-20 14:26 伟衙内 阅读(37) 评论(0) 推荐(0) 编辑
摘要: Intent (定义) Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions 阅读全文
posted @ 2022-05-19 15:56 伟衙内 阅读(28) 评论(0) 推荐(0) 编辑
摘要: Intent (定义) Decouple an abstraction from its implementation so that the two can vary independently. (从实现中分离出抽象,使两者可以独立变化) Also Known As (别名) Handle/Bo 阅读全文
posted @ 2022-05-19 11:45 伟衙内 阅读(17) 评论(0) 推荐(0) 编辑
摘要: Intent (定义) Convert the interface of a class into another interface clients expect. (将一个接口转换为客户端希望的另一个接口)Adapter lets classes work together that could 阅读全文
posted @ 2022-05-13 11:21 伟衙内 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 观察者模式 有上面这个案例,也是我最近听到的一个案例,新浪天气和百度天气都是观察者,气象局如果有数据改变,那么调用notifyObserver通知其他观察者,然后其他观察者就可以进行改变。 疑问 这是一个很理想的状态,但是真实情况是,SinaWeather和BaiduWeather每隔一段时间去监听 阅读全文
posted @ 2022-05-12 20:32 伟衙内 阅读(16) 评论(0) 推荐(0) 编辑
摘要: Intent (定义) Ensure a class only has one instance, and provide a global point of access to it.(确保一个类只有一个实例,并提供全局访问的通道) Motivation (案例) How do we ensure 阅读全文
posted @ 2022-05-12 14:54 伟衙内 阅读(8) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 19 下一页