Appologies for the abstract nature of the question, but although I'm thinking of the implementation in something like java or c#, it is the concept in general that is slightly bugging me at the moment.
With most languages when one uses boolean logic for testing purposes only one answer will be valid.
if (fridgeDoorClosed !=true)
closeFridge();
else
eatSandwich();
But what about when multiple paths may be correct? Supposing a form on a webpage where the user uses checkboxes to choose what s/he wants to see. A horrendously inelegant way to do this would be:
if ((checkbox1==true)&&(checkbox2==true)&&(checkbox3==true))
blah
else if
((checkbox1==true)&&(checkbox2==true)&&(checkbox3==false))
blah
and so on, being careful about order, of course.
In languages such as java and c# case switch statements can be used, leaving out the usual break statements to force a cascade. But can such a method be used in a practical manner?