摘要:Definition Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation. UML class diagram Participants The classes and/or obj...
阅读全文
摘要:Definition Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. UML class diagram Participants ...
阅读全文
摘要:Definition Provide a unified interface to a set of interfaces in a subsystem. Façade defines a higher-level interface that makes the subsystem easier to use. UML class diagram Participants ...
阅读全文
摘要:Definition Use sharing to support large numbers of fine-grained objects efficiently. UML class diagram Participants The classes and/or objects participating in the Flyweight pattern ...
阅读全文
摘要:Definition Provide a surrogate or placeholder for another object to control access to it. UML class diagram Participants The classes and/or objects participating in the Proxy pattern ar...
阅读全文
摘要:Definition Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality. UML class diagram Participants ...
阅读全文
摘要:Definition Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations. UML class diagram Partici...
阅读全文
摘要:Composite Definition Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and c...
阅读全文
摘要:Adapter Definition Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwis...
阅读全文
摘要:原型模式:Prototype Definition Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype. ...
阅读全文
摘要:Factory Method Definition Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a c...
阅读全文
摘要:创建型的设计模式:(builder 生成器模式) Definition (定义) Separate the construction of a complex object from its representation so that the same construction process can create different representations. (将一个复合对象...
阅读全文
摘要:创建型的设计模式中的(Abstract Pattern)抽象工厂模式 定义(difinition): Provide an interface for creating families of related or dependent objects without specifying their concrete classes . 提供一个接口可以创建一系列没有实现类的,相关联...
阅读全文
摘要:我以前在 cn.thespoke.net的文章,转贴 最近看了一些C#来描述设计模式的资料。也听了Microsoft做的讲座。想总结一下。在http://www.dofactory.com里面看到了用C#描述的设计模式,觉得以前自己做的软件不好。因为经常修改软件使我很痛苦,所以决定痛改前非。 这里说说自己经常会用到的模式 1. 单件模式 http://msdn.microsoft...
阅读全文