package dao;

import dao.impl.StudentDAOImpl;
import dao.impl.TeacherDAOImpl;
import dao.impl.LeaveRequestDAOImpl;

/**
 * DAO工厂类，用于获取各种DAO的实例
 */
public class DAOFactory {
    private static final StudentDAO studentDAO = new StudentDAOImpl();
    private static final TeacherDAO teacherDAO = new TeacherDAOImpl();
    private static final LeaveRequestDAO leaveRequestDAO = new LeaveRequestDAOImpl();

    /**
     * 获取StudentDAO实例
     * @return StudentDAO实例
     */
    public static StudentDAO getStudentDAO() {
        return studentDAO;
    }

    /**
     * 获取TeacherDAO实例
     * @return TeacherDAO实例
     */
    public static TeacherDAO getTeacherDAO() {
        return teacherDAO;
    }

    /**
     * 获取LeaveRequestDAO实例
     * @return LeaveRequestDAO实例
     */
    public static LeaveRequestDAO getLeaveRequestDAO() {
        return leaveRequestDAO;
    }
}
