3 ms·
I don't know where you work but I generally find that employees do not calculate their own pay, apart from maybe reporting hours they tend to not be involved in
by flukus 7y ago
I don't know where you work but I generally find that employees do not calculate their own pay, apart from maybe reporting hours they tend to not be involved in the transaction at all, HR does the work and deposits it to the employees bank account.
If we subscribe to the idea that OO should model the real world (I don't) then the HR class is definitely where the work should be done.
- Supermancho 7y ago> employees do not calculate their own pay My paychecks list the hours and rate paid, more often than not. But dispensing with that (because it's not relevant), a class isn't an actor-model. The tried-and-true Class Car->Drive() example (the car is doing something) is a contrived way to illustrate one of the ways a class can be used, as a learning tool. You don't want to create systems with that mentality, as it will always disappoint and spawn countless new webs of inheritance as time goes on. This is all hand waving, but that's a rather important issue to realize. There's no science behind design yet and it hasn't changed since the late 90s (when I started). My experience teaches me as with your own. I am afraid we'll just have to agree to disagree.