Helios::ObjectDriver - class to return Helios::ObjectDriver::DBI objects pointing to the collective database
# in code that needs a Helios::ObjectDriver::DBI object my $driver = Helios::ObjectDriver->getDriver(); # if the config parameters have already been parsed, # save the trouble of reparsing them by passing the configuration my $conf = Helios::Config->parseConfig(service_name => 'MyService'); my $driver = Helios::ObjectDriver->getDriver(config => $conf);
The Helios::ObjectDriver class provides methods to create Helios::ObjectDriver::DBI driver objects that connect to the Helios collective database. Having this code in a central class reduces the amount of duplicated code in various other Helios classes and provides a level of abstraction between the Helios API classes and Data::ObjectDriver, the current ORM.
Like Helios::Config and Helios::Logger classes, Helios::ObjectDriver is not designed to be instantiated and thus provides only class methods.
debug set/getConfig set/getDriver
# need more data here
The initDriver() method is the method that actually instantiates the driver object connecting to the database.
If a config is specified, Helios::ObjectDriver will use the parameters in the config hash to connect to the database and instantiate the driver object. If config is not specified, initDriver() will call Helios::Config->parseConfig() to (re)parse the current Helios configuration itself. If the Helios config has been parsed already, specifying it in the initDriver() call will save some time.
THROWS: Helios::Error::ObjectDriverError if the driver creation fails.
Andrew Johnson, <lajandy at cpan dot org>
Copyright (C) 2013 by Logical Helion, LLC.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.
This software comes with no warranty of any kind.