请问这段java代码怎么重构?就是想要实现动态传入类型

    if("student".equals(type)){
        Student student=new Student();
        student.setAccount(account);
        student.setPassword(password);
        student.setCreateTime(new Date());
        studentService.save(student);
    }else if("labor".equals(type)){
        Labor labor=new Labor();
        labor.setAccount(account);
        labor.setPassword(password);
        labor.setCreateTime(new Date());
        laborService.save(labor);
    }else if("manager".equals(type)){
        Manager manager=new Manager();
        manager.setAccount(account);
        manager.setPassword(password);
        manager.setCreateTime(new Date());
        managerService.save(manager);
    }else if("xuegong".equals(type)){
        XueGong xueGong=new XueGong();
        xueGong.setAccount(account);
        xueGong.setPassword(password);
        xueGong.setCreateTime(new Date());
        xueGongService.save(xueGong);
    }
 反射
http://blog.csdn.net/smartboy_01/article/details/23201391
为了简单,可定义一个接口,包括setAccount setPassword等方法
Class classType = Class.forName("类名");  
接口 obj = (接口)classType.newInstance();  
obj.setAccount()
...