|
namespace BusinessRules.Evolution_Four
{
/// <summary>Null Object Pattern</summary>
/// <remarks>
/// <list type="bullet">
/// <item><description>Provides an interface identical to IncomeTaxEngine Object's so that a null
/// object can be substituted for a real object</description></item>
/// <item><description>Implements its interface to do nothing. What exactly it means to do
/// nothing depends on what sort of behaviour the client is expecting</description></item>
/// <item><description>When there is more than one way to do nothing, more than one Null Object
/// class may be required</description></item>
/// </list>
/// </remarks>
internal class NullIncomeTaxEngine : IncomeTaxEngine
{
#region Methods
/// <summary>
/// Calculates the tax rate.
/// </summary>
/// <returns>
/// Returns a double representing the tax liability for the investor.
/// </returns>
public override Calculation<Investor> CalculateTaxRate()
{
return delegate { return 0.0; };
}
/// <summary>
/// Calculates the tax liability.
/// </summary>
/// <returns>
/// Returns a double representing the tax rate for the investor.
/// </returns>
public override Calculation<Investor> CalculateTaxLiability()
{
return delegate { return 0.0; };
}
#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.