--- nfo/perl/libs/DesignPattern/Bridge.pm 2003/02/11 10:34:19 1.7 +++ nfo/perl/libs/DesignPattern/Bridge.pm 2003/02/14 14:20:05 1.8 @@ -1,7 +1,10 @@ ## -------------------------------------------------------------------------------- -## $Id: Bridge.pm,v 1.7 2003/02/11 10:34:19 joko Exp $ +## $Id: Bridge.pm,v 1.8 2003/02/14 14:20:05 joko Exp $ ## -------------------------------------------------------------------------------- ## $Log: Bridge.pm,v $ +## Revision 1.8 2003/02/14 14:20:05 joko +## + modified mixin behaviour +## ## Revision 1.7 2003/02/11 10:34:19 joko ## + loaded module may now lack 'mixin::with' declaration ## + this gets us the possibility to load modules from any perl namespace @@ -163,19 +166,26 @@ #bless $self, $package; # V2: + $self->mixinPackage($package); + + if (my $method = $options->{method}) { + $self->$method(); + } + return 1; + + } + + sub mixinPackage { + my $self = shift; + my $package = shift; + # switch into foreign package and prepare for mixin $self->mixin_prepare($package); # switch into local package (scope which uses DesignPattern::Bridge) and mixin plugin-module $self->mixin_do($package); - if (my $method = $options->{method}) { - $self->$method(); - } - - return 1; - } # TODO: maybe refactor to DesignPattern::Object? what about the '$logger'?