On 10/10/2011 7:19 AM, bls wrote:
if(args[0] == "MySQL")
factory = new MySQLFactory();
else
factory = new PostreSQLFactory();

Perhaps my design pattern knowledge is a bit shaky (it is), but isn't the point of a factory to give it hints about what you want to create, and it decides how to do it? Something like:

Database d = Factory.gimmeAConnection("MySql", "server", "username", "pwd");

Reply via email to