策略模式是一种定义一系列算法的方法,从概念上来看,所有这些算法完成的都是相同的工作,只是实现不同,它可以以
相同的方式调用所有的算法,减少了各种算法类与使用算法类之间的耦合。
策略模式在spring中的使用
http://javapub.iteye.com/blog/751653
public class ProxyFactoryBean{
private ClassLoader JavaDoc beanClassLoader = ClassUtils.getDefaultClassLoader();
protected Object getProxy(AopProxy aopProxy) {
return aopProxy.getProxy(this.beanClassLoader);//通过相应的beanClassLoader来使用不同的算法。
}
}
相同的方式调用所有的算法,减少了各种算法类与使用算法类之间的耦合。
策略模式在spring中的使用
http://javapub.iteye.com/blog/751653
public class ProxyFactoryBean{
private ClassLoader JavaDoc beanClassLoader = ClassUtils.getDefaultClassLoader();
protected Object getProxy(AopProxy aopProxy) {
return aopProxy.getProxy(this.beanClassLoader);//通过相应的beanClassLoader来使用不同的算法。
}
}