std.database design suggestion

Johann MacDonagh johann.macdonagh.no at spam.gmail.com
Mon Oct 10 20:14:48 PDT 2011


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");


More information about the Digitalmars-d mailing list