Re: object_states 3
by Rocco Caputo other posts by this author
Nov 20 2006 8:26AM messages near this date
object_states 3
|
make test errors
Unless I'm overlooking a detail in your code, this looks legal.
--
Rocco Caputo - rcaputo@[...].com
On Nov 18, 2006, at 22:25, lanas wrote:
> Folks,
>
> Re.: choosing which method amongst objects having same method names.
> The technique described in POE::Session seems to fulfill this goal but
> moreover, it enables some kind of an easy double-dispatch of both
> object
> and method since Perl is reflective:
>
> my $obj_a = osObj1->new();
> my $obj_b = osObj2->new();
>
> POE::Session->create
> (
> object_states =>
> [
> $obj_a => {method1_obja => 'method1',
> method2_obja => 'method2',
> },
> $obj_b => {method1_objb => 'method1',
> method2_objb => 'method2',
> },
> ],
>
> inline_states =>
> {
> _start => \&startIt,
> },
> );
>
> sub startIt
> {
> print "Started !\n";
> $_[KERNEL]->alias_set("os");
>
> my $methodNumber = 2;
> my $objName = 'a';
>
> $_[KERNEL]->post('os', "method$methodNumber\_obj$objName");
> }
>
>
> Any comments on the subject are welcomed.
>
> Cheers,
> Al
Thread:
Lanas
Rocco Caputo
|