博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Java设计模式(14)--代理
阅读量:2790 次
发布时间:2019-05-13

本文共 1120 字,大约阅读时间需要 3 分钟。

Intent

Provide a surrogate or placeholder for another object to control access to it.

 

How to

Proxy
maintains a reference that lets the proxy access the real subject
provides an interface identical to Subject's

Subject
defines the common interface for RealSubject and Proxy

RealSubject
defines the real object that the proxy represents

Known case
delay initialization
asyn call
remote proxy (RMI)
security validation
cache

 

UML

 

样例代码

转载地址:http://frfmd.baihongyu.com/

你可能感兴趣的文章
在vs2017中遇到“fatal error RC1015: cannot open include file 'winres.h'.”
查看>>
Select2插件的快速使用
查看>>
Java面向对象三大特性
查看>>
结合案例深入解析迭代器模式
查看>>
mysql锁机制总结,以及优化建议
查看>>
深入挖崛:mysql主从复制原理
查看>>
leetcode算法题--数字序列中某一位的数字
查看>>
leetcode算法题--把数组排成最小的数
查看>>
leetcode算法题--把数字翻译成字符串
查看>>
leetcode算法题--礼物的最大价值
查看>>
leetcode算法题--数组中数字出现的次数
查看>>
leetcode算法题--数组中数字出现的次数 II
查看>>
leetcode算法题--队列的最大值
查看>>
linux内核kfifo(二)
查看>>
gcc 提供的原子操作
查看>>
gcc build a project
查看>>
OVS搭建虚拟机全过程(四十五)
查看>>
linux bridge搭建虚拟机全过程
查看>>
Servlet入门(三)Servlet初体验
查看>>
Servlet入门(四)Servlet生命周期
查看>>