您的位置:首页 > 其它

HeadFirst设计模式之装饰者模式

2016-03-09 12:57 381 查看
一、

1.The Decorator Pattern attaches additional responsibilities to an object dynamically.Decorators provide a fl exible alternative to subclassing for extending functionality.

2.if we rely on inheritance, then our behavior can only be determined statically at

compile time. In other words, we get only whatever behavior the superclass gives us or that we
override. With composition, we can mix and match decorators any way we like... at runtime.

二、

三、JavaIO的装饰者模式
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: