Ray's playground

 
上一页 1 2 3 4 5 6 ··· 56 下一页

2012年4月25日

Composite(Chapter 13 of Pro Objective-C Design Patterns for iOS)

摘要: When Would You Use the Composite Pattern? You would naturally think about using the pattern whenYou want to have abstract tree representation of objects (part-wholehierarchies). You want clients to treat all objects in the composite structure andindividual objects uniformly. 阅读全文

posted @ 2012-04-25 14:21 Ray Z 阅读(225) 评论(0) 推荐(0) 编辑

2012年4月24日

Observer(Chapter 12 of Pro Objective-C Design Patterns for iOS)

摘要: Defines a one-to-many dependency between objects so that whenone object changes state, all its dependents are notified and updated automatically. 阅读全文

posted @ 2012-04-24 17:04 Ray Z 阅读(273) 评论(0) 推荐(0) 编辑

2012年4月23日

Mediator(Chapter 11 of Pro Objective-C Design Patterns for iOS)

摘要: The Mediator pattern is used to define a centralized place where interactions amongobjects can be handled in one mediator object. Other objects don’t need to interact witheach other directly, so it reduces dependency among them. 阅读全文

posted @ 2012-04-23 16:59 Ray Z 阅读(256) 评论(0) 推荐(0) 编辑

2012年4月20日

Façade(Chapter 10 of Pro Objective-C Design Patterns for iOS)

摘要: There are three common situations in which you would consider using this pattern: Your subsystem is getting complex. A lot of classes are evolved fromapplying patterns. You can use a façade to provide a simpler interfacefor the subsystem classes. You can use façades to layer your subsystem 阅读全文

posted @ 2012-04-20 16:27 Ray Z 阅读(192) 评论(0) 推荐(0) 编辑

Bridge(Chapter 9 of Pro Objective-C Design Patterns for iOS)

摘要: Abstraction is the parent interface that defines the high-level abstraction interface usedby clients. It has a reference to an instance of Implementor, which defines the interfacefor implementation classes. This interface doesn’t need to correspond to Abstraction’sinterface; in fact, they can be qu. 阅读全文

posted @ 2012-04-20 15:28 Ray Z 阅读(236) 评论(0) 推荐(0) 编辑

2012年4月17日

Adapter(Chapter 8 of Pro Objective-C Design Patterns for iOS)

摘要: 阅读全文

posted @ 2012-04-17 18:14 Ray Z 阅读(228) 评论(0) 推荐(0) 编辑

2012年4月10日

Singleton(Chapter 7 of Pro Objective-C Design Patterns for iOS)

摘要: #import"Singleton.h"@implementationSingletonstaticSingleton*sharedSingleton=nil;+(Singleton*)sharedInstance{if(sharedSingleton_==nil){sharedSingleton_=[[superallocWithZone:NULL]init];}returnsharedSingleton_;}+(id)allocWithZone:(NSZone*)zone{return[[selfsharedInstance]retain];}-(id)copyWith 阅读全文

posted @ 2012-04-10 12:47 Ray Z 阅读(281) 评论(0) 推荐(0) 编辑

2012年4月3日

Builder(Chapter 6 of Pro Objective-C Design Patterns for iOS)

摘要: We discussed Abstract Factory in the last chapter. You might have realized that both the Abstract Factoryand Builder patterns are similar in many ways in terms of being used for abstract object creation. However,they are very different. Builder focuses on constructing a complex object step-by-step,. 阅读全文

posted @ 2012-04-03 15:08 Ray Z 阅读(393) 评论(0) 推荐(0) 编辑

2012年3月27日

Abstract Factory(Chapter 5 of Pro Objective-C Design Patterns for iOS)

摘要: The Abstract Factory and Factory Method patterns are very similar in many ways. It’s very confusing tomany people when to use which one of them. Both of them can be used for the same purposes of creatingobjects without letting clients know what exact concrete objects are being returned. The followi. 阅读全文

posted @ 2012-03-27 11:22 Ray Z 阅读(293) 评论(0) 推荐(0) 编辑

2012年3月26日

Factory Method(Chapter 4 of Pro Objective-C Design Patterns for iOS)

摘要: The abstract Product defines the interface of objects the factory method creates. TheConcreteProduct implements the Product interface. The Creator defines the factorymethod that returns an object of Product. It may also define a default implementation ofthe factory method that returns a default Con. 阅读全文

posted @ 2012-03-26 15:04 Ray Z 阅读(276) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 56 下一页

导航