Code:
sub new : method # public static
{
my ($class, $db_type, $conn_str, $encoding) = @_;
my $self = {};
[blue]
my $dbio_impl;
# ????????
my $impl_class = "GECC::JobRequest::DAO::${db_type}DBIOImpl";
eval {
require $impl_class;
$dbio_impl = $impl_class->new($conn_str, $encoding);
foreach (qw/ SYSDATE_FUNC STRTODATE_FUNC STRTOTIME_FUNC /) {
$self->{$_} = eval("${impl_class}::$_");
}
};
if ($@) {
warn $@;
} else {
$self->{-impl} = $dbio_impl;
}
[/blue]
bless $self, $class;
}