I don't remember exactly is it a common pattern but I have a class (Factory Method pattern) which has method for creating other classes (Abstract Factory pattern) depending on enum parameter:
public class FooFactoryFactory {
public FooFactory createFactory (FooFactoryType type) {
switch (type) {
case AFoo:
return new AFooFactory ();
break;
case BFoo:
return new BFooFactory ();
break;
default:
throw new RuntimeException ("...");
}
}
}
public interface FooFactory {
Foo createFoo ();
FooItem createFooItem ();
}
FooFactory has several implementations as well as Foo interface and FooItem interface (common Abstract Factory pattern).
So, how to rename FooFactoryFactory?
Maybe, FooFactoryCreator? (Think of this name during writing this question). IMHO it's nice, how do you think?