in reply to Re: design suggestions for object integration wanted
in thread design suggestions for object integration wanted
...where the $tree, $taxon and $matrix objects have a way of notifying the $cdat object to trigger the handlers specified for their respective ids when they change state.my $matrix_id = $cdat->add_matrix( $matrix ); my $tree_id = $cdat->add_tree( $tree ); $cdat->add_handler( 'listener' => $tree_id, 'observable' => $matrix_id, 'handler' => \&handler, ); sub handler { my ( $listener, $observable, $method, @args ) = @_; # $method is called on $observable, # but supervisor $cdat creates an # indirection layer to notify listeners print "$method '@args'" # prints "set_name 'New matrix'" } $matrix->set_name( 'New matrix' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: design suggestions for object integration wanted
by GrandFather (Saint) on Sep 20, 2006 at 19:43 UTC | |
by rvosa (Curate) on Sep 20, 2006 at 20:27 UTC |