对于请求培训课程的下属,或者我应该有一个代表Approver对象的javabean,然后设置一个描述此Approver级别的属性,是否更好地使用多个javabean代表不同管理级别的Approvers?
示例(多个):
public class StudentApprover1 implements Serializable {
private static final long serialVersionUID = 1L;
private String request_id;
private String student;
private String approver;
private String approver_status_code;
public class StudentApprover2 implements Serializable {
private static final long serialVersionUID = 1L;
private String request_id;
private String student;
private String approver;
private String approver_status_code;
或(单一)
public class StudentApprover implements Serializable {
private static final long serialVersionUID = 1L;
private String request_id;
private String student;
private String approver;
private String approver_level; <---------------------- set their level 1=supervisor, 2=manager, 3=director, etc...
private String approver_status_code;
答案 0 :(得分:0)
那么,它们是不同的类,每个类都有特定的逻辑,或者只是同一个类中不同的对象状态?这是你应该问自己的问题。
它不能被称为“错误”或“正确”,而是取决于该类在您的模型中所代表的内容。