阅读背景:

Decorator(Chapter 16 of Pro Objective-C Design Patterns for iOS)

来源:互联网 
We have introduced the Decorator pattern with its concepts and different approaches to implement it in Objective-C. A true subclass implementation uses a more structured approach to connect different decorators. A categories approach is simpler and more lightweight than its counterpart. It’s suitable for applications that require only a small amount of decorators for existing classes. Although categories are different from actual subclassing and cannot strictly adapt the original flavor of the pattern, They fulfill the intent to solve the same kind of problems. The Decorator pattern is a natural choice for designing applications like the image filtering example. Any combination of image filters can be applied or removed dynamically without affecting the integrity of the original behaviors of UIImage. We have introduced the Decorator pattern with



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: