2011年6月17日

Design Pattern----06.Creational.Singleton.Pattern (Delphi Sample)

摘要: IntentEnsure a class has only one instance, and provide a global point of access to it. Encapsulated “just-in-time initialization” or “initialization on first use”. ProblemApplication needs one, and only one, instance of an object. Additionally, lazy initialization and global access are necessary.Di 阅读全文

posted @ 2011-06-17 17:19 Tony Liu 阅读(730) 评论(0) 推荐(0) 编辑

Design Pattern----05.Creational.Prototype.Pattern (CSharp Sample)

摘要: IntentSpecify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype. Co-opt one instance of a class for use as a breeder of all future instances. The new operator considered harmful. ProblemApplication “hard wires” the class of object to creat 阅读全文

posted @ 2011-06-17 16:37 Tony Liu 阅读(516) 评论(0) 推荐(0) 编辑

Design Pattern----04.Creational.Object Pool.Pattern (Java Sample)

摘要: IntentObject pooling can offer a significant performance boost; it is most effective in situations where the cost of initializing a class instance is high, the rate of instantiation of a class is high, and the number of instantiations in use at any one time is low.ProblemObject pools (otherwise know 阅读全文

posted @ 2011-06-17 14:47 Tony Liu 阅读(692) 评论(0) 推荐(0) 编辑

Design Pattern----03.Creational.FactoryMethod.Pattern (Delphi Sample)

摘要: Intent Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses. Defining a “virtual” constructor... 阅读全文

posted @ 2011-06-17 14:14 Tony Liu 阅读(927) 评论(0) 推荐(0) 编辑

Design Pattern----02.Creational.Builder.Pattern (Delphi Sample)

摘要: Intent Separate the construction of a complex object from its representation so that the same construction process can create different representations. Parse a complex representation, create one of s... 阅读全文

posted @ 2011-06-17 13:44 Tony Liu 阅读(1066) 评论(0) 推荐(0) 编辑

导航