java设计模式之代理模式
来源:互联网 发布:js正则判断是否是数字 编辑:程序博客网 时间:2024/06/03 21:38
public interface Sourceable{
public void method();
}
public class Source implements Sourceable{
@Override
public void method(){
System.out.println("this is the source method!");
}
}
public class Proxy implements Sourceable{
private Source source;
public Proxy(){
super();
this.source = new Source();
}
@Override
public void method(){
System.out.println("this is the proxy method");
before();
source.method();
after();
}
public void before(){
System.out.println("this is the before method");
}
public void after(){
System.out.println("this is the after method");
}
}
public class TestProxy{
public static void main(String[] args){
Sourceable sourceable = new Proxy();
sourceable.method();
}
}
public void before(){
System.out.println("this is the before method");
}
- Java设计模式之代理设计模式
- Java设计模式之代理
- Java设计模式之代理
- java设计模式之代理
- java之代理设计模式
- java之代理设计模式
- Java设计模式之代理模式
- Java设计模式之计数代理模式
- JAVA设计模式之代理模式
- JAVA设计模式之代理模式
- java设计模式之代理模式
- Java 设计模式 之 代理模式
- java设计模式之代理模式Proxy
- 设计模式之代理模式 java (1)
- java设计模式之代理模式
- java设计模式之静态代理模式
- Java:设计模式之代理模式Proxy
- java设计模式之代理模式
- 属性
- 用Eclipse和GDB构建ARM交叉编译和在线调试环境
- Single Number III
- mysql left join on 与 where 筛选的差异
- Linux上用udev自动识别并挂载U盘
- java设计模式之代理模式
- SwipeRefreshLayout在onCreate使用setRefreshing(true)无效
- Odoo 8项目管理Project Management使用图文介绍
- 冒泡排序
- 分布式中的一致性模型
- House Robber II 如何获得最大的钱系列2
- 获取当前版本信息
- Java 基础——构造器和方法的区别
- 点滴积累,后置“++”的实现