Click here to Skip to main content
12,634,117 members (24,326 online)
Click here to Skip to main content

Stats

75.1K views
64 downloads
116 bookmarked
Posted

Who cares about Domain Rules?

, 20 Nov 2006 MIT
With this article, I am evolving a domain problem towards the best possible solution.
BusinessRules
0 - Procedural_Way
0 - Procedural_Way.smp
ProceduralWay.cd
Tests
1 - Evolution One
1 - Evolution One.smp
EvolutionOne.cd
Tests
2 - Evolution Two
2 - Evolution Two.smp
EvolutionTwo.cd
Tests
3 - Evolution Three
3 - Evolution Three.smp
EvolutionThree.cd
IncomeTaxEngine.cd
Tests
4 - Evolution Four
4 - Evolution Four.smp
EvolutionFour.cd
Tests
5 - Evolution Five
5 - Evolution Five.smp
EvolutionFive.cd
TaxBandGenerator.cd
Tests
bin
Debug
BusinessRules.dll
BusinessRules.dll.lastcodeanalysissucceeded
NMock2.dll
BusinessRules.csproj.user
obj
Debug
BusinessRules.dll
TempPE
Properties
Tools
NMock2.dll
nunit.framework.dll
using System.Collections.Generic;

namespace BusinessRules.Evolution_Five
{
    /// <summary>Null Object Pattern</summary>
    /// <remarks>
    /// <list type="bullet">
    /// <item><description>Provides an interface identical to Tax Band Generator Object 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 NullTaxBandGenerator : TaxBandGenerator
    {
        #region Methods

        /// <summary>
        /// Creates the tax bands.
        /// </summary>
        /// <returns></returns>
        /// <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, double.MaxValue, 0.0));
            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

Share

About the Author

Maruis Marais
Web Developer
New Zealand New Zealand
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.161208.2 | Last Updated 21 Nov 2006
Article Copyright 2006 by Maruis Marais
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid