I am trying to understand how entities operate in multiple bounded contexts.
Given an Employee of a Company. In (for example) the Human Resources context, this person has a name, surname, address, salary reference number, and bank account. But in the Accounting context all that is relevant is the salary reference number and bank account.
在会计方面,您是否拥有一个雇员实体和一个价值-Type(例如SalariedEmployee
)?
class Employee
{
public BankAccount BankAcountDetails { get; set; }
public string FullName { get; set; }
public Address ResidentialAddress { get; set; }
public string SalaryRef { get; set; }
}
SalariedEmployee
category (?) : 雇员的价值类型
class SalariedEmployee
{
public SalariedEmployee(string salaryRef, BankAccount bankAcountDetails)
{
...
}
public string SalaryRef { get; }
public BankAccount BankAcountDetails { get; }
}
人力资源处是否在受约束的情况下归还这一信息? 或者,你在这两种情况下都使用“雇员”类别?