Programming pattern suggestion for logic matrix

tablaFreak
tablaFreak used Ask the Experts™
on
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?  

Thanks,
Steve
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
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

Author

Commented:
thanks

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