shamgod

一、

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的装饰者模式

 

分类:

技术点:

相关文章:

猜你喜欢
  • 2021-09-24
  • 2021-10-24
  • 2021-08-28
  • 2021-11-09
  • 2021-12-11
  • 2021-09-24
相关资源
相似解决方案