--- nfo/perl/libs/DesignPattern/Bridge.pm 2003/02/14 14:20:05 1.8 +++ nfo/perl/libs/DesignPattern/Bridge.pm 2003/02/20 20:50:32 1.10 @@ -1,7 +1,13 @@ ## -------------------------------------------------------------------------------- -## $Id: Bridge.pm,v 1.8 2003/02/14 14:20:05 joko Exp $ +## $Id: Bridge.pm,v 1.10 2003/02/20 20:50:32 joko Exp $ ## -------------------------------------------------------------------------------- ## $Log: Bridge.pm,v $ +## Revision 1.10 2003/02/20 20:50:32 joko +## + small exception handling: now inheriting from little Exception object +## +## Revision 1.9 2003/02/18 18:35:30 joko +## + encapsulated/abstracted some more functionality: sub load_single +## ## Revision 1.8 2003/02/14 14:20:05 joko ## + modified mixin behaviour ## @@ -37,7 +43,10 @@ use strict; use warnings; -use base qw( DesignPattern::Object ); +use base qw( + DesignPattern::Object + DesignPattern::Exception +); use Data::Dumper; @@ -129,6 +138,22 @@ sub load { my $self = shift; + my $modulename = shift; + my $options = shift; + + if (ref $modulename eq 'ARRAY') { + foreach (@$modulename) { + $self->load_single($_, $options); + } + } else { + $self->load_single($modulename, $options); + } + + } + + sub load_single { + + my $self = shift; my $modulename_load = shift; my $options = shift; @@ -146,6 +171,9 @@ # this is the module testing phase - use mixin doesn't seem to propagate errors by default eval("use $package;"); + $self->checkExceptions(); + +=pod if ($@) { $meta->{loaded}->{$package} = 0; # include caller information @@ -158,6 +186,7 @@ print $msg, "\n"; } } +=cut #print "ref-1: ", ref $self, "\n"; #print "ref-2: ", ref $self::SUPER, "\n";