/[cvs]/nfo/perl/libs/DesignPattern/Bridge.pm
ViewVC logotype

Diff of /nfo/perl/libs/DesignPattern/Bridge.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by joko, Tue Feb 11 10:34:19 2003 UTC revision 1.8 by joko, Fri Feb 14 14:20:05 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## --------------------------------------------------------------------------------  ## --------------------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.8  2003/02/14 14:20:05  joko
6    ##  + modified mixin behaviour
7    ##
8  ##  Revision 1.7  2003/02/11 10:34:19  joko  ##  Revision 1.7  2003/02/11 10:34:19  joko
9  ##  + loaded module may now lack 'mixin::with' declaration  ##  + loaded module may now lack 'mixin::with' declaration
10  ##  + this gets us the possibility to load modules from any perl namespace  ##  + this gets us the possibility to load modules from any perl namespace
# Line 163  sub new { Line 166  sub new {
166      #bless $self, $package;      #bless $self, $package;
167    
168      # V2:      # V2:
169        $self->mixinPackage($package);
170        
171        if (my $method = $options->{method}) {
172          $self->$method();
173        }
174    
175        return 1;
176        
177      }
178      
179      sub mixinPackage {
180        my $self = shift;
181        my $package = shift;
182        
183      # switch into foreign package and prepare for mixin      # switch into foreign package and prepare for mixin
184      $self->mixin_prepare($package);      $self->mixin_prepare($package);
185    
186      # switch into local package (scope which uses DesignPattern::Bridge) and mixin plugin-module      # switch into local package (scope which uses DesignPattern::Bridge) and mixin plugin-module
187      $self->mixin_do($package);      $self->mixin_do($package);
188    
     if (my $method = $options->{method}) {  
       $self->$method();  
     }  
   
     return 1;  
       
189    }    }
190    
191    # TODO: maybe refactor to DesignPattern::Object? what about the '$logger'?    # TODO: maybe refactor to DesignPattern::Object? what about the '$logger'?

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed