Click here to Skip to main content
15,880,796 members
Articles / Programming Languages / C#

Who cares about Domain Rules?

Rate me:
Please Sign up or sign in to vote.
4.96/5 (88 votes)
20 Nov 2006MIT12 min read 95.7K   85   118  
With this article, I am evolving a domain problem towards the best possible solution.
using System.Collections.Generic;

namespace BusinessRules.Evolution_Five
{
    /// <summary>
    /// New Zealand tax band generator object to contruct tax bands.
    /// </summary>
    internal class NewZealandTaxBandGenerator : TaxBandGenerator
    {
        #region Methods

        /// <summary>
        /// Creates the tax bands.
        /// </summary>
        /// <remarks>Factory Method that constructs the tax band collection.</remarks>
        public override List<TaxBand> CreateTaxBands()
        {
            List<TaxBand> taxBands = new List<TaxBand>();

            taxBands.Add(new TaxBand(0.0, 19500.99, 0.195));
            taxBands.Add(new TaxBand(19501.00, 60000.99, 0.33));
            taxBands.Add(new TaxBand(60001.00, double.MaxValue, 0.39));

            return taxBands;
        }

        #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.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Web Developer
New Zealand New Zealand
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions