, , .
# :
public class Company
{
public Employee[] employees;
public Building[] buildings;
}
public Things[] employeesAndBuildings;
, - . , .
The second example is shorter and depending on what the format is reading, the reader can just as easily separate the two elements. However, for readability, the format may become more unreadable if everything goes in a different order:
<company>
<employee />
<building />
<employee />
<building />
<employee />
</company>
I would choose the first format.
source
share