#工厂类
把实现接口的类扔进代理中,代理去增加扩展功能,这样就实现了切面编程。好处是没有继承,也就是说没有依赖关系,降低了耦合度,从而达到解耦的目的
public class MyBeanFactory{
public static IUserService createUserService(){
final IUserService userService = new UserServiceImpl();
final MyAspect aspect = new MyAspect;
IUserService proxyService = (IUserService)Proxy.newProxyInstance(