* add state and callback pattern * add command and template-method pattern * add iterator pattern * add bridege and DI pattern * fix issue #1600 * add converter,proxy,visitor pattern * add caching,composite,delegation,dirty-flag,interpreter patterns * add dao and producer-consumer * add dto and provate class data pattern * fix #1646 png path problems * fix #1646 composite png path case problem Co-authored-by: Mike <admin@xiaod.info> Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
layout, title, folder, permalink, categories, tags
layout | title | folder | permalink | categories | tags | |
---|---|---|---|---|---|---|
pattern | Delegation | delegation | /patterns/delegation/ | Structural |
|
或称
代理模式
目的
它是一种让对象将某种行为向外部表达,但实际上将实现该行为的责任委托给关联对象的技术。
类图
适用性
使用委托模式以实现以下目的
- 降低类的耦合性
- 组件的行为相同,但是意识到这种情况将来可能会改变。