Ray's playground


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 externalized and lightweight.
􀀁 Relatively few shared objects can replace the original bunch of objects after the objects’ extrinsic state is removed.
􀀁 Your app doesn’t depend on object identity since shared objects cannot have unique identities.

posted on 2012-05-18 11:03  Ray Z  阅读(242)  评论(0编辑  收藏  举报