in reply to Method Chaining and Accessors
While chaining is neato and all, I can't think of a good reason to support this use. What's wrong with simply passing a hash of configuration information to your constructor? This seems far more reasonable to me:
my $obj = My::Class->new( foo => 'foo', bar => 'bar' );
Under the hood, your constructor can either modify the object directly or call the accessors/mutators and let them do the work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Method Chaining and Accessors
by f00li5h (Chaplain) on Apr 05, 2007 at 02:03 UTC | |
by misterwhipple (Monk) on Apr 05, 2007 at 03:13 UTC | |
|
Re^2: Method Chaining and Accessors
by grinder (Bishop) on Apr 05, 2007 at 07:34 UTC | |
|
Re^2: Method Chaining and Accessors
by jhourcle (Prior) on Apr 05, 2007 at 19:45 UTC |