On Friday, 2 January 2015 at 15:33:06 UTC, Suliman wrote:
Thanks! I will try!
D is my first compilable language, I wrote only some scripts
without OO before.
So in my case your suggestion is best practice? Or there is any
more simple way to pass config and data to MySQL class?
I think it's fine to have a global config instance. Alternatively
you can pass the config to both the seismoDownlead and
MySqlWhatever classes.
// there ist enforce(cond, msg) for this in
std.exception/std.conv, dunno.
if (!exists(confpath)) throw new Exception("ERROR: config.ini do
not exists");
// it becomes
enforce(exists(confpath), "ERROR: config.ini does not exist");