What Would the Trasfer Object Look Like if I Have a List of Objects?
What would the "transfer object" look like If I have a List of objects and each object has its properties? Do I have a HashSet in my transfer object?
To clarify my question, let me give an example.
Say, I have a store and I sell music CDs. Each CD has composer, title, and price as its properties. How do I code the transfer object to pass data between J2EE tiers?
In my JSF backing bean, I have java.util.List and I use DataModel to display all CDs in tabulation:
import java.util.ArrayList;
import java.util.List;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
publicclass CDManagerBean
{
private String title;
private Float price;
private String artist;
private List cds =new ArrayList();
private DataModel cdModel =new ListDataModel();
{
cdModel.setWrappedData(cds);
}
// getters and setters
// addCD(), editCD(), and updateCD() methods
}
I also have a CD java class:
publicclass CDimplements java.io.Serializable
{
private String title;
private String artist;
privatefloat price;
public CD(){}
// getters and setters
}

