java设计模式之代理模式
来源:互联网 发布:蚌埠巨人网络 编辑:程序博客网 时间:2024/05/16 13:44
public interface Sourceable{
public void method();
}
public class Source implements Sourceable{
@Override
public void method(){
System.out.println("this is source method");
}
}
public class Proxy implements Sourceable{
private Source source;
public Proxy(Source source){
this source = source;
@Override
public void method(){
System.out.println("this is proxy method");
}
public void after(){
System.out.println("this is after method");
}
public void before(){
before();
System.out.println("this is before method");
after();
}
}
}
public class TestProxy{
public static void main(String[] args){
Sourceable proxy = new Proxy();
proxy.method();
}
}
0 0
- Java设计模式之代理设计模式
- Java设计模式之代理
- Java设计模式之代理
- java设计模式之代理
- java之代理设计模式
- java之代理设计模式
- Java设计模式之代理模式
- Java设计模式之计数代理模式
- JAVA设计模式之代理模式
- JAVA设计模式之代理模式
- java设计模式之代理模式
- Java 设计模式 之 代理模式
- java设计模式之代理模式Proxy
- 设计模式之代理模式 java (1)
- java设计模式之代理模式
- java设计模式之静态代理模式
- Java:设计模式之代理模式Proxy
- java设计模式之代理模式
- No mapping found for HTTP request with URI [/operation-platform/js/displaytag.js] in DispatcherServl
- 圆形背景TextView
- Visual Studio 2013 Professional Key
- R应用-多元线性回归
- 考取PMP的价值何在?
- java设计模式之代理模式
- JAVA 对象拷贝
- Behavior of Active Dataguard(ADG) When Apply Node Aborts/Crash (文档 ID 1613719.1)
- Java Web---HTTP应用层协议
- Spring Tool Suite
- (转)URI和URL及URN的区别
- python做考勤统计
- No module named gevent
- Java线程池使用