I simply meant specifying the connection information in one location (the class)
um? The connection info isn't in the class. It's still in the class's user, just like it would be if Apache::Session::MySQL had been used directly.
my $session_obj = Local::WPSession->new(dbh => $dbh, id => $sid);
# ^^^^
If you want to move the info needed to create the dbh into Local::WPSession (and possibly even create the dbh within the new class as well), why not make Local::WPSession inherit from Apache::Session::MySQL and simply override the constructor? That way, the user will be able to access all of Apache::Session::MySQL's methods without forcing you to recreate the interface or to create a new interface.
|