mirror of
https://github.com/zhwei820/learn.lianglianglee.com.git
synced 2025-11-20 08:03:44 +08:00
fix img
This commit is contained in:
@@ -331,7 +331,7 @@ class GlassesDecorator(ClothingDecorator):
|
||||
<h4>装饰模式</h4>
|
||||
<p><strong>装饰模式</strong>(Decorator Pattern):动态地给一个对象增加一些额外的职责(Responsibility),就增加对象功能来说,装饰模式比生成子类实现更为灵活。</p>
|
||||
<p>就故事中这个示例来说,由结构庞大的子类继承关系转换成了结构紧凑的装饰关系:</p>
|
||||
<p><img src="assets/a01f99d0-71f2-11e8-b1ea-d92fd075c722.jpg" alt="enter image description here" /></p>
|
||||
<p><img src="assets/a01f99d0-71f2-11e8-b1ea-d92fd075c722.jpg" alt="png" /></p>
|
||||
<p>继承关系:</p>
|
||||
<p><img src="assets/cc4f8d30-71f2-11e8-9e76-835574e7e257.jpg" alt="img" /></p>
|
||||
<p>装饰关系</p>
|
||||
|
||||
Reference in New Issue
Block a user