3 ms·
My point is that IT doesn't (and shouldn't) need to know about employee pay. Extending the Employee class to HR, Accounting and IT is a bad design. You're viol
by cgrealy 7y ago
My point is that IT doesn't (and shouldn't) need to know about employee pay. Extending the Employee class to HR, Accounting and IT is a bad design.
You're violating ISP here. The Employee class can implement IThingThatGetsPaid, but IThingThatHasNetworkAccess should know nothing about pay.
The Employee itself should have the minimal amount of information it needs. Prefer interacting with an object through a small API surface. It's not "smearing a concept across domains", it's the exact opposite. It's confining a concept to the appropriate domain.
The original design pollutes the Employee interface with multiple concerns.
- jsymolon 7y ago> IT doesn't (and shouldn't) need to know about employee pay Project Budgeting, is one concern. You may not need to know the exact cost, but, having a hourly rate is useful. "A,B & C 80 hrs a piece, how much for the budget ?" Don't know have to ask HR for ....