I'm trying to create some variation of the abstract factory pattern.
The Factory is supposed to allow a plugin-like insertion of new implementation of concrete factories.
e.g.
public class AbstractFactory
{
//some code here
public static void addNewImpl(String implName, /*class path or something else*/)
{
//dynamic class validity check
//save class somehow (db I guess)
}
public static getImpl(String name)
{
//is impl available
//return if valid
}
}
I'm not sure I'm tackling the problem correctly or if I should reconsider my design.
I would go ahead like this: