
代理模式
无始之名
Nothing is better than reading code.
展开
-
Java实现代理模式
抽象角色package test.proxy;/** * Created by dubby on 16/3/28. */ public interface Demo { String hello(); }真实角色package test.proxy;/** * Created by dubby on 16/3/28. */ public class DemoImp implement原创 2016-03-28 16:28:15 · 398 阅读 · 0 评论 -
Java实现代理模式(动态代理)
抽象角色package com.dubby.proxy.real;/** * Created by dubby on 16/3/28. */ public interface Demo { String hello(); }真实角色package com.dubby.proxy.real;/** * Created by dubby on 16/3/28. */ public cla原创 2016-03-28 17:02:11 · 400 阅读 · 0 评论 -
Java实现代理模式(CGLIB)
先用你喜欢的方式加上依赖,我以maven为例:<dependency> <groupId>cglib</groupId> <artifactId>cglib</artifactId> <version>2.2.2</version> </dependency>真实角色:public class Hello { public void hello() {原创 2016-04-26 15:01:39 · 913 阅读 · 0 评论