next prev What Works Slide #95

Delegation Example

Consider a Universal IM Client.

    sub send {
        my $self = shift;
        $self->{messager}->send(@_);
    }

$self->{messager} contains an IM protocol handler.

You can plug any protocol you like into $self->{messager}



next prev ToC Copyright © 2002-2003 Norman Nunley & Michael G Schwern