So to create a concrete factory that extends from an abstract factory class, I usually create a 'producer' class to determine what abstract factory to use.
For example:
public abstract class AbstractFactoryProducer
{
public AbstractFactory createFactory(String foo)
{
if(foo.equals("foo"))
{
return new FooFactory();
}
else if (foo.equals("bar"))
{
return new BarFactory();
}
... n if elses where n is number of factories
}
Is there a way around using a ton of if/else statements or switch statements?