Example 8.10 Entity Inherits Value Object Strategy - Value Object Class // This is the value object class inherited by // the entity bean public class ContactVO implements java.io.Serializable { // public members public String firstName; public String lastName; public String address; // default constructor public ContactVO() {} // constructor accepting all values public ContactVO(String firstName, String lastName, String address){ init(firstName, lastName, address); } // constructor to create a new VO based // using an existing VO instance public ContactVO(ContactVO contact) { init (contact.firstName, contact.lastName, contact.address); } // method to set all the values public void init(String firstName, String lastName, String address) { this.firstName = firstName; this.lastName = lastName; this.address = address; } // create a new value object public ContactVO getData() { return new ContactVO(this); } }