On 10/28/07 4:13 PM, Peter Karman wrote: + my $key = join('.', $domain, $type); + + $class->db_cache({}) unless $class->db_cache; + + if (exists $class->db_cache->{$key}) + { + return $class->db_cache->{$key}; + } + + my $db = $class->new(%args); + $class->db_cache->{$key} = $db;
Is this how we want to handle new() with args beyond type and domain? Or is this more appropriate? + if (exists $class->db_cache->{$key}) + { + my $db = $class->db_cache->{$key}; + $db->init(%args); + return $db; + } Or maybe it croaks if additional args are present instead? Opinions? -John ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object