今天學習了設計模式中的裝飾者模式?不過對於我們何時使用裝飾者模式不是很清楚?請指教
阿神2017-04-17 13:27:53
Extensions to class responsibilities are optional.
This is explained in Objective-c Programming~
Another: The book "Design Patterns" says that decoration mode: dynamically adds some additional responsibilities to an object. In terms of extended functions, decoration is more flexible than generating subclasses.
Note: This design pattern will be used when creating image filters for UIImage in iOS development~
PHP中文网2017-04-17 13:27:53
The above content is reproduced from Baidu Encyclopedia. . . .