DDD: Modeling Has- a
I am trying to follow the DDD, and I have a doubt about modeling this
example situation:
I have an entity Employee:
public class Employee{
public Int32 Id {get;set;}
public String Name {get;set;}
public Decimal Salary {get;set;}
}
Is it common to all employees, a name and salary. But some may have ill
health retirements. Each retirement is associated with an Employee, so I
have this entity:
public Retirement {
public Int32 Id {get;set;}
public DateTime Begining {get;set;}
public DateTime End {get;set;}
public Employee Employee {get;set;}
}
My doubt is: Does Employee entity has a list of Retirement ?? (An employee
exist w/o a retirement, BUT retirement does not exist w/o Employee) If I
have to get all employees that is retired today, is it more "logical" to
search into Employee or into Retirement?
No comments:
Post a Comment