|
In complex applications written in C#, we may need many methods which do essentially
similar functions but are just different enough to be considered unique. For example,
we may have to calculate a person's tax liability and would need to implement a method
for doing this calculation in our application program. However, there are many
different rules when it comes to tax calculations and they vary throughout the world.
While there may be many rules, one basic equation stays the same: Your net income
equals your gross income minus a computed tax amount. We would probably have to
implement different methods for each type of tax calculation. And, we could give each
method a unique name such as TaxCalc1, TaxCalc2, TaxCalc3, etc. But wouldn't it be
nice to just name the method TaxCalc and pass different arguments to it based on the
computation desired?
|