misc. garnisher ; ornamenter
2、具体组件(ConcreteComponent):继承自抽象组件的具体对象,也可以给这个对象添加一些职责。3、装饰者(Decorator):装饰抽象类,用于扩展Component的功能,..
基于844个网页-相关网页
装饰者模式可以动态地给一个对象增加其他职责。
The Decorator Pattern attaches additional responsibilities to an object dynamically.
房间的墙壁被粉刷成当时英国装饰者想象中的中国风情。
The walls were painted with what English decorators then imagined to be scenes of China.
为了扩展功能,装饰者提供了比继承更灵活的替代方案。
Decorators provide a flexible alternative to subclassing for extending functionality.
应用推荐