BOFactory.java
上传用户:nbxinmin
上传日期:2021-10-09
资源大小:46k
文件大小:2k
源码类别:

Internet/IE编程

开发平台:

Java

  1. package com.xdf.exams.bo;
  2. import com.xdf.exams.bo.service.ExamServiceImp;
  3. import com.xdf.exams.bo.service.LogServiceImp;
  4. import com.xdf.exams.bo.service.QuestionServiceImp;
  5. import com.xdf.exams.bo.service.ResultServiceImp;
  6. import com.xdf.exams.bo.service.StudentServiceImp;
  7. import com.xdf.exams.bo.service.TeacherServiceImp;
  8. import com.xdf.exams.dao.DAOFactory;
  9. public class BOFactory {
  10. public static IExamService getExamService() {
  11. ExamServiceImp ser = new ExamServiceImp();
  12. ser.setExamrecorddao(DAOFactory.getExamrecordDAO());
  13. ser.setQuestiondao(DAOFactory.getQuestionDAO());
  14. ser.setResultdao(DAOFactory.getResultDAO());
  15. ser.setSubjectdao(DAOFactory.getSubjectDAO());
  16. return ser;
  17. }
  18. public static ILogService getLogService() {
  19. LogServiceImp ser = new LogServiceImp();
  20. ser.setLoginlogdao(DAOFactory.getLoginlogDAO());
  21. ser.setStudentdao(DAOFactory.getStudentDAO());
  22. ser.setTeacherdao(DAOFactory.getTeacherDAO());
  23. return ser;
  24. }
  25. public static IQuestionService getQuestionService() {
  26. QuestionServiceImp ser = new QuestionServiceImp();
  27. ser.setExamrecorddao(DAOFactory.getExamrecordDAO());
  28. ser.setQuestiondao(DAOFactory.getQuestionDAO());
  29. ser.setResultdao(DAOFactory.getResultDAO());
  30. ser.setSubjectdao(DAOFactory.getSubjectDAO());
  31. ser.setOptionsdao(DAOFactory.getOptionsDAO());
  32. return ser;
  33. }
  34. public static IResultService getResultService() {
  35. ResultServiceImp ser = new ResultServiceImp();
  36. ser.setExamrecorddao(DAOFactory.getExamrecordDAO());
  37. ser.setResultdao(DAOFactory.getResultDAO());
  38. return ser;
  39. }
  40. public static IStudentService getStudentService() {
  41. StudentServiceImp ser = new StudentServiceImp();
  42. ser.setExamrecorddao(DAOFactory.getExamrecordDAO());
  43. ser.setStudentdao(DAOFactory.getStudentDAO());
  44. ser.setResultdao(DAOFactory.getResultDAO());
  45. return ser;
  46. }
  47. public static ITeacherService getTeacherService() {
  48. TeacherServiceImp ser = new TeacherServiceImp();
  49. ser.setTeacherdao(DAOFactory.getTeacherDAO());
  50. return ser;
  51. }
  52. }