2
我只是想知道DTO類是否包含另一個對象。請告訴我下面的代碼是否是有效的DTO類?數據傳輸對象類可以包含其他對象嗎?
class Address implements Serializable{
private String city;
private String location
}
class EmployeeDTO implements Serializable{
private String name;
private int age;
private Address address;
//setters and getters
}
[Complex DTO structure]的可能重複(http://stackoverflow.com/questions/11667377/complex-dto-structure) –