* #1771 Move translations to a new directory to have more organization * #1771 spanish translation * #1771 change the language codes to follow ISO 639-1 and change the links * #1771 remove country flags
31 lines
712 B
Markdown
31 lines
712 B
Markdown
---
|
|
layout: pattern
|
|
title: Delegation
|
|
folder: delegation
|
|
permalink: /patterns/delegation/zh
|
|
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)
|