* 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 * add abstract document pattern and version-number pattern * add ambassador pattern * add acyclic-visitor and api-gateway pattern * add abstract-factory pattern * add active-object pattern * add aggregator-microservices and arrange-act-assert pattern * update async-method-invocation pattern * add balking and business-delegate pattern * add bytecode and circuit-break pattern * update arrange/act/assert pattern problems * add csch pattern * add language code, correct pic path * #1805 update permalink Co-authored-by: Subhrodip Mohanta <subhrodipmohanta@gmail.com> Co-authored-by: Mike <admin@xiaod.info> Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>
31 lines
713 B
Markdown
31 lines
713 B
Markdown
---
|
|
layout: pattern
|
|
title: Delegation
|
|
folder: delegation
|
|
permalink: /patterns/delegation/
|
|
categories: Structural
|
|
language: zh
|
|
tags:
|
|
- Decoupling
|
|
---
|
|
|
|
## 或称
|
|
代理模式
|
|
|
|
## 目的
|
|
它是一种让对象将某种行为向外部表达,但实际上将实现该行为的责任委托给关联对象的技术。
|
|
|
|
## 类图
|
|

|
|
|
|
## 适用性
|
|
使用委托模式以实现以下目的
|
|
|
|
* 降低类的耦合性
|
|
* 组件的行为相同,但是意识到这种情况将来可能会改变。
|
|
|
|
## 鸣谢
|
|
|
|
* [Delegate Pattern: Wikipedia ](https://en.wikipedia.org/wiki/Delegation_pattern)
|
|
* [Proxy Pattern: Wikipedia ](https://en.wikipedia.org/wiki/Proxy_pattern)
|