In a payroll system I have a class called
Salary. To prepare salary we need Earnings and Deduction details of employees.
Earnings may be: Basic Salary, Overtime, Allowances etc. Deductions may be: Fines, Loan installments, Welfare contributions etc.
I just want to know what's the relationship between these
Earning classes. It seems that the
Earning is a part of
salary so it may have a composition/aggregation relationship.
However you calculate
salary as : [
Date fields may be common for both
Deduction classes which could be inherited from
So that could you please clarify what relationships the above classes have in this scenario? I'd also appreciate if you could show an example of how those relationships are implemented in classes.
EDIT: Im trying to develop a win forms system employing MVP pattern and my language is C#.net. Basically I have employee attendance in the database so using two SPs I generate earnings and deductions. Then the user is give an UI to edit figures or to enter random figures like special allowances, fines etc. Finally all deduction and earning details will be saved in a single table called SalaryTrans [sal_id, emp_id, pay_period, basic_salary,overtime_payment, allowances, fines , other_deductions, ..., gross_salary].