If I break my Objects down to 'Single Responsibilities', is there a fundamental thought whether like objects should live together or separately, for example if I have
class Employee_DataProvider() : IEmployee_DataProvider { ... };
class Employee_Details() : IEmployee_Details { ... };
class Employee_Payroll() : IPayroll() { ... };
class Employee_LeaveProcessing() : ILeaveProcessing_Client { ... };
...
Is it bad smell to have all these living inside, yet loosely coupled to through interfaces, an owning Employee class:
class Employee
{
IEmployee_DataProvider _dataProvider;
IEmployee_Details _details;
IPayroll _payroll;
ILeaveProcessing_Client _leaveProcessing;
//My functions call the interfaces above
}
or is the thinking more around keeping these classes completely separate (or as least as separate as is posible) in the code? Or are both these methods a valid usage of SRP?
EDIT: I do not want critique on the feasibility of the object given in the example, I just made it up to illustrate the question. I agree data, leave and payroll processing are not the domain of the employee class.
It does appear though that SRP is asking me to move away from the object as real world representation to object as a properties and methods around a single functional concept