title: Code improvements for implementing business logic
body: <p>I had asked <a href="https://stackoverflow.com/questions/2126729/what-pattern-patterns-work-best-for-developing-rule-decision-engine">this</a> question previously on SO. This is related to it. We have code base similar to this:</p>
  
  <pre><code>IRecipie FindRecipiesYouCanMake(IEnumerable&lt;Ingredientes&gt; stuff, Cook cook)
  {
   if(stuff.Any(s=&gt;s.Eggs &amp;&amp; s.Flour) &amp;&amp; cook.DinerCook)
   {
    if(s=&gt;s.Sugar)
     return new Pancake("Yum");
    if(s=&gt;s.Salt)
     return new Omlette("Yay");
   }
   /*.....
   ......
   .....
   loads of ifs and buts and else*/
  }
  </code></pre>
  
  <p>I want to get rid of this mess and take a more data structure and OO route. Even the code sample i have provided is not as horrendous as it is. I looked at the specification pattern and found it applicable. Any ideas how to improve the code.</p>
  
  <p>EDIT: Now that I realize it, I might even like to implement a method of this signature:</p>
  
  <pre><code>List&lt;IRecipe&gt; WhatAllCanBeCooked(IEnumerable&lt;Ingredients&gt; stuff, Cook cook);
  </code></pre>