
设计模式
zou274
码农,关注互联网,软件管理,喜欢最新鲜的,最有意思的想法.
展开
-
[模式之集思广义] Builder Pattern
1. Concept将一个复杂的构建与其表示相分离,使得同样的构建过程可以创建不同的表示 --《设计模式》GOF--------------原创 2011-09-21 18:25:08 · 453 阅读 · 0 评论 -
[模式之集思广义] Prototype pattern
1.ConceptSpecify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype. - Gof2.原创 2011-10-07 17:01:20 · 583 阅读 · 0 评论 -
设计模式学习总结-创建型模式
设计模式学习总结-创建型模式五大创建型设计模式的注意事项:1.单例(Singleton)构造函数private或protected,防止外部实例化;双层锁定实例化,防止多线程的多个实例化;类要sealed,防止被继承后派生添加实例;饿汉、懒汉两转载 2011-10-07 17:41:20 · 446 阅读 · 0 评论 -
UML类图中的关系
http://gaojiewyh.iteye.com/blog/407013 UML类图中的关系分为四种:泛化、依赖、关联、实现;关联关系又可以细化为聚合和组合。1. 泛化(Generalization)泛化是父类和子类之间的关系,子类继承父类的所有结构和行为。在子类中可以增加新的结构和行为,也可以覆写父类的行为。 2. 依赖(Dependency)依转载 2011-11-14 17:05:28 · 721 阅读 · 0 评论 -
[模式之集思广义] Adapter Pattern
1. Concept: 将一个类的接口转换成客户希望的另外一个接口。Adapter模式使得原本由于接口不兼容而不能一起工作的那些类可以一起工作。(GoF)Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn'原创 2011-11-14 17:55:05 · 592 阅读 · 0 评论