摘要:Role:The purpose of the Singleton pattern is to ensure that there is only one instance of a class, and that there is a global access point to that obj...
阅读全文
随笔分类 - Design Pattern
摘要:What is a State Machine? Any device that changes its state from one to another due to some actions are defined to be state machines. For example an AT
阅读全文
摘要:参考:http://www.cnblogs.com/justinw/archive/2007/02/06/641414.html
阅读全文
摘要:关于 23 种设计模式的有趣见解在网络上流畅很广的一篇旧文,暂时没找到原作者,目前所看到的最早转载时间是 2005 年 2 月 28 日。作者用轻松的语言,形象解释了 23 种模式,有很好的启发作用。(更新:已找到一篇发布时间是 2003 年 11 月20 日发布的文章,原标题是《追MM与设计模式(java的32种设计模式)》。谢谢@DarkRiver_尘提供线索。)创建型模式1、FACTORY—追MM少不了请吃饭了,麦当劳的鸡翅和肯德基的鸡翅都是MM爱吃的东西,虽然口味有所不同,但不管你带MM去麦当劳或肯德基,只管向服务员说“来四个鸡翅”就行了。麦当劳和肯德基就是生产鸡翅的Factory工厂
阅读全文