are are are are are are are are are are are are
源代码在线查看: servicefactory.java
/* * ServiceFactory.java * * Created on 2006年5月14日, 下午7:29 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package enova.service; import enova.dao.*; import enova.service.impl.*; /** * * @author vlinux */ public class ServiceFactory { /** Creates a new instance of ServiceFactory */ public ServiceFactory() { } public static Object makeService(String service){ if(service.equals("ClassCourseService")){ return new ClassCourseServiceImpl( (ClassCourseDao)DaoFactory.makeDao("ClassCourseDao") ); }else if(service.equals("ClassService")){ return new ClassServiceImpl( (ClassDao)DaoFactory.makeDao("ClassDao") ); }else if(service.equals("CourseService")){ return new CourseServiceImpl( (CourseDao)DaoFactory.makeDao("CourseDao") ); }else if(service.equals("DepartmentService")){ return new DepartmentServiceImpl( (DepartmentDao)DaoFactory.makeDao("DepartmentDao") ); }else if(service.equals("RootService")){ return new RootServiceImpl( (RootDao)DaoFactory.makeDao("RootDao") ); }else if(service.equals("ScoreService")){ return new ScoreServiceImpl( (ScoreDao)DaoFactory.makeDao("ScoreDao") ); }else if(service.equals("SpecialService")){ return new SpecialServiceImpl( (SpecialDao)DaoFactory.makeDao("SpecialDao") ); }else if(service.equals("StudentService")){ return new StudentServiceImpl( (StudentDao)DaoFactory.makeDao("StudentDao") ); }else if(service.equals("TeacherService")){ return new TeacherServiceImpl( (TeacherDao)DaoFactory.makeDao("TeacherDao") ); }else{ return null; } } }