Ray's playground

 

2012年5月18日

Memento(Chapter 23 of Pro Objective-C Design Patterns for iOS)

摘要: You’d think about using the pattern when all of the following applies: 􀀁 You need to save the object’s state as a snapshot or a portion of it,which can be restored later. 􀀁 You need to hide the interface with which obtaining the state wouldexpose the implantation details. 阅读全文

posted @ 2012-05-18 13:44 Ray Z 阅读(268) 评论(0) 推荐(0) 编辑

Proxy(Chapter 22 of Pro Objective-C Design Patterns for iOS)

摘要: You’d naturally think about using the pattern when 􀀁 You need a remote proxy that provides a local representative for anobject in a different address space or in the network. 􀀁 You need a virtual proxy to create heavy-weighted objects on demand.We will implement that kind of proxy in a code examp. 阅读全文

posted @ 2012-05-18 11:13 Ray Z 阅读(205) 评论(0) 推荐(0) 编辑

Flyweight(Chapter 21 of Pro Objective-C Design Patterns for iOS)

摘要: You’d naturally think about using it when all of the following are true: 􀀁 Your app uses a lot of objects. 􀀁 Keeping objects in memory can affect memory performance. 􀀁 Most of the object’s unique state (extrinsic state) can be externalizedand lightweight. 􀀁 Relatively few shared objects can rep. 阅读全文

posted @ 2012-05-18 11:03 Ray Z 阅读(242) 评论(0) 推荐(0) 编辑

导航