|
|
ok, the question is asking about calc the payroll.
according to the structure, each class may have different payroll cost, the same as department and division. but the share the common thing : payrollcost. for this. create interface that contain the payrollcost, let's say Ipayroll. back to the structure, divison contains department, department contains employees. and employee will have 3 different class.
based on these things, division and department should have different costcenter. Class basecost: Ipayroll. (can contain 3 class attributes) then warped by class department and division. so at the end of day. employee class will contain obj from an interface. by given the attributes, it can caculate the payroll. in the memory, only 1 reference. |
|