package net.nw.service;
public class BeanFactory {
public static Object getBean(String beanName){
try{
return Class.forName(beanName).newInstance();
}catch( Exception ex){
ex.printStackTrace();
return null;
}
}
}
package net.nw.dao;
//所有的磁盘实现的接口
public interface Disk {
public void read();
public void write(String data);
}