craigmcguff
Programmer
I have a set of procedural code for tax calculations for Australia and New Zealand that I want to implement in a more logical class design (C#).
On the face of it they seem simlar, both ultimately calculate an amount of tax, based on a given tax code, date, gross pay etc.
Where they diverge is in the number and type of both input and output parameters. Umm let's see if I can clarify that...
NZ requires 3-4 parameters to calculate the amount, the return amount is actually 3 separate figures added together of which we may need the individual components.
Australia is the same but there is a larger number of input parameters, and the return amount may have up to 4-5 components.
I am struggling to come up with a consistent interface for this and I am looking for some fresh input.
Should I use an interface or build a class hierarchy, or is there no real relationship?
I suspect I need to build an input object and an output object that can be specialised by country.
Thoughts?
On the face of it they seem simlar, both ultimately calculate an amount of tax, based on a given tax code, date, gross pay etc.
Where they diverge is in the number and type of both input and output parameters. Umm let's see if I can clarify that...
NZ requires 3-4 parameters to calculate the amount, the return amount is actually 3 separate figures added together of which we may need the individual components.
Australia is the same but there is a larger number of input parameters, and the return amount may have up to 4-5 components.
I am struggling to come up with a consistent interface for this and I am looking for some fresh input.
Should I use an interface or build a class hierarchy, or is there no real relationship?
I suspect I need to build an input object and an output object that can be specialised by country.
Thoughts?