http://qs1969.pair.com?node_id=644284

archimago has asked for the wisdom of the Perl Monks concerning the following question:

management has decided that we will be refactoring the codebase of our mod_perl web app. i'm looking at our database access methods and trying to decide whether to re-structure them. here's the code i've inherited.
module layout:
EG/DB.pm EG/DB/ EG/DB/Access.pm EG/DB/Clients.pm EG/DB/Vendors.pm EG/DB/Employees.pm EG/Example.pm
relevant code from modules:
package EG::DB.pm; use DBI; sub new { db connection happens here } sub commit {...} package EG::DB::Access.pm use base 'EG::DB::Clients'; use base 'EG::DB::Vendors'; use base 'EG::DB::Employees'; package EG::DB::Clients; use base 'EG::DB'; sub get_client_id_for_username { ... } package EG::Example; use EG::DB::Access; my $dbh = EG::DB::Access->new(); my $client_id = $dbh->get_client_id_for_username($client_username);
the good: not so good: so is it bad enough to warrant re-structuring? is the longish search path that expensive with mod_perl or should we just leave it alone. Does it really buy us that much convenience? Should Access.pm be rolled into EG::DB to eliminate one additional search level? Thanks for any opinions.