|
namespace BusinessRules.Evolution_Three
{
/// <summary>
/// Investor Domain object.
/// </summary>
public class Investor : IInvestor
{
#region Fields
private double income;
private IIncomeTaxEngine taxEngine = IncomeTaxEngine.CreateInstance();
#endregion
#region C'tors
/// <summary>
/// Initializes a new instance of the <see cref="Investor"/> class.
/// </summary>
/// <param name="income">The income.</param>
public Investor(double income)
{
this.income = income;
}
#endregion
#region Properties
/// <summary>
/// Gets or sets the income.
/// </summary>
/// <value>The income.</value>
public double Income
{
get { return income; }
set { income = value; }
}
/// <summary>
/// Gets the tax liability.
/// </summary>
/// <value>The tax liability.</value>
public double TaxLiability
{
get { return taxEngine.CalculateTaxLiability(Income); }
}
/// <summary>
/// Gets the tax rate.
/// </summary>
/// <value>The tax rate.</value>
public double TaxRate
{
get { return taxEngine.CalculateTaxRate(Income); }
}
/// <summary>
/// Gets or sets the business rule.
/// </summary>
/// <remarks>The Get is only valid within the Investor Domain object.</remarks>
public IIncomeTaxEngine TaxEngine
{
set { taxEngine = value; }
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.