为什么Spring的ApplicationContext.getBean与接口被认为是坏的?

时间:2015-12-09 06:52:44

标签: java

  public interface test{
  void do();
 }

public Class testImp
 {
   @Autowired
   ApplicationContext appContext;

public T getBeanWithType(T type){

 @Override    
 public T T getRepository(T type) {

    return (T) appContext.getBean(type);    
 }

pulic void getType(T type){

return  getBeanWithType(test.Class)
  }
}

0 个答案:

没有答案
相关问题