Output computation strategy problem
<p>Maybe not the best title I can think of but my problem is this:</p>

<p>I have to design a C# application which takes a bunch of inputs, perform some computation on the input according to a bunch of rules to get a set of results.</p>

<p>The problem is that the rules can change as an when required. To complicate things, many of them are cross tab look ups and conditionals. For example,</p>

<pre><code>public string rule_GetFruitForThisSeason(Hamper design)
{
    // crosstab of 2 properties of values 400 to 100 and 600 to 500 respectively.
    if(design.pty1 &gt; 400 &amp;&amp; design.pty &gt; 600) return "Apple";
    else if(design.pty1 &gt; 200 &amp;&amp; design.pty &gt; 600) return "Pear";
    else if(design.pty1 &gt; 100 &amp;&amp; design.pty &gt; 600) return "Orange";
    else if(design.pty1 &gt; 400 &amp;&amp; design.pty &gt; 500) return "Grape";
    else if(design.pty1 &gt; 200 &amp;&amp; design.pty &gt; 500) return "Berry";
    else if(design.pty1 &gt; 100 &amp;&amp; design.pty &gt; 500) return "Peach";
}
</code></pre>

<p>And then during the next season, all the fruits might change again! (even the conditionals may change.) Ideally, I don't want the programmer to change the fruits every season. The Hamper Designers should be able to do it themselves.</p>

<p>Worse still there could be rules that depend on the output for example</p>

<pre><code>public string rule_GetBoxForFruit(string fruit)
{
   if(fruit == "Apple" || fruit == "Pear" || fruit == "orange" || fruit == "peach") return "big box";
   else return "small box";
}
</code></pre>

<p>I have been thinking through various methods and currently I am using excel for its LOOKUP() and generally ability to evaluate formulas, and then directly reading the excel results. But it is still a huge cumbersome task.</p>

<p>Anyone has any ideas on how to approach this in a better way? Thank you.</p>
