public class DaoFactory {
private static final DaoFactory factory = new DaoFactory();
private DaoFactory(){}
public static DaoFactory getInstance(){
return factory;
}
public <T> T createDao(String className,Class<T> clazz){
try{
T t = (T) Class.forName(className).newInstance();
return t;
}catch (Exception e) {
throw new RuntimeException(e);
}
}
}
DAOFactory复用代码
原创Java_3y ©著作权
文章标签 设计模式 javascript 文章分类 Java 后端开发
-
Java NIO - IO多路复用详解
本文主要对IO多路复用,Ractor模型以及Java NIO对其的支持。
Java IO/NIO/AIO