title: Is there any design pattern to avoid a nested switch case?
body: <p>I have seen similar kind of threads, But, not sure how to exactly apply the solutions to my case. My problem is that i have a set of usecases lets say 'A','B','C',There are certain commands i need to execute when the input passed(2 usecases are the input) is any 2 of the listed usecases. for example:</p>
  
  <pre><code>switch(input1)
  {
  case A:
  break;
  case B:
  break;
  case C:
  break;
  }
  </code></pre>
  
  <p>inside the each case, i will have to check on input 2, 
  so, the final code could look like </p>
  
  <pre><code>switch(input1)
  {
  case A:
  {
  switch(input2):
  case B:
  break;
  case c:
  break;
  }
  case B:
  {
  switch(input2):
  case A:
  break;
  case c:
  break;
  }
  ....
  
  }
  </code></pre>
  
  <p>I was thinking to use a map of (pair,command) and remove this switch cases, but is there any alternative better solution or design problem to solve this problem?</p>