Programming pattern suggestion for logic matrix

tablaFreak used Ask the Experts™
Hello Experts,

Does anyone have a recommendation how best to deal with two or three dimensional logic matrixes? In other words, suppose I have a problem involving two, three or more parameters, each of which can be true or false, and depending on their combinations, perform different functions. Is there a standard way of approaching this problem?  

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Use a factory pattern to identify the strategy pattern you wish to execute.

I.e. the factory selection is based on your parameter set, because in large matrices not all combinations will be viable, so a factory pattern utilising a map keyed on a parameter set would normally be most effective.  

The factory would return the implementation of a strategy pattern instance that you would have performed on the particular combination of parameters



Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial