Decorator 在程序运行时生成新的操作,这些新的操作是原有的操作的变体

ISimpleWriter
SimpleStreamWriter
OozinozFilter
LowerCaseFilter
客户代码
类图:
 
The Decorator Pattern attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
posted @ 2007-01-15 16:06  南守拥  阅读(343)  评论(2编辑  收藏  举报