design patterns
zx917
这个作者很懒,什么都没留下…
展开
-
40 strategy pattern
Strategy:defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.Principles:Identify转载 2012-06-25 15:31:32 · 355 阅读 · 0 评论 -
42 Decorator pattern
Decorator:Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to sub-classing for extending functionality.Principles:Classes should be open f转载 2012-06-26 14:06:48 · 11044 阅读 · 0 评论 -
43 Singleton Pattern
Singleton:ensures a class has only one instance, and provides a global point of access to it. Java example 1: public class Singleton { private static Singleton instance; private Singlet转载 2012-08-21 16:23:14 · 261 阅读 · 0 评论