为了避免设计模式1的缺点,我们介绍一下封装entity bean值域的value objec的概念。value object,用某些语言的术语来说,就是一个结构类型,因为他们和corba的结构类型非常类似。 value Object code snippet for Company public class CompanyStrUCt implements java.io.Serializable { public Integer comId; //PRimary Key public String comName; public String comDescription; public java.sql.Timestamp mutationDate; } value Object code snippet for Employee public class EmployeeStruct implements java.io.Serializable { public Integer empId; //Primary Key public Integer comId; //Foreign Key public String empFirstName;
public String empLastName; public java.sql.Timestamp mutationDate; }