mardi 15 mars 2016

Should entity class hold the collection of related child records according to OO guideline?

 public class Employee
{
    public string Id { get; set; }
    public string Name { get; set; }
    public int Age { get; set; }
}

public class EmployeeHistory
{
    public string EmployeeId { get; set; }
    public string EventName { get; set; }
    public string EventDescription { get; set; }
}

Is it recommended to expose a property in the Employee class which gives collection of the EmployeeHistory records which belong to the employee? In good OO design, can such collection be part of the Employee class?

Aucun commentaire:

Enregistrer un commentaire