As described in the motivation of using the Abstract Factory, i need an interface which i want to be highly flexible, i.e, it should have a number of possible behaviors. So, following the AF design pattern, I define an abstract class with the interface functions as follows:
class WidgetFactory{
...
public:
CreateScrollBar();
CreateButton();
...
};
and then i define a concrete subclass of WidgetFactory for each behavior, with each subclass implementing the interface for a particular behavior.
My problem is I have my interface quite large, i.e., i have 10 functions in the abstract class and each function has 4 possible implementations. So it turns out that i have to implement 4^10 subclasses accounting for each possible behavior. Any idea or suggestion how could i avoid such an exponential blow up?