Originally posted by Jose Botella:
Another consideration:
This could be done in a static getInstance method in AbstractFactory. A singleton pattern is appropiate to obtain the subclass instance of AbstractFactory.
Do you prefer using an actual factory object and instance methodsto using static methods? With the latter, you can have a static initialization method that determines the implementation characteristics; in its easiest form you could simply load a static implementation object with the appropriate condition-specific factory, and then the static methods would simply pass through to the implementation object.
This is only valid when you can never have two different abstract factories active in the same JVM, but that's exactly suited for platform dependence issues.
Just sort of thinking out loud.
Joe