in reply to Overloading inherited class methods
Instead of polluting the %ARGS hash (which can lead to threading problems should you ever go that way, and can royally confuse someone if they create a new instance of Foo::People without passing an _open_this_id pair, and then find that they've gotten an _open_this_id field with an id they didn't expect), why not do
This nice thing about this approach is that it propogates up the chain of overriden methods nicely. That is, if Foo::People provides an %ARGS template, then it can both extend and selectively override an %ARGS template provided by Foo::PersistentObject. All without mucking up global state.sub new { my $class = shift; $class->SUPER::new(%ARGS, @_); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Overloading inherited class methods
by Ovid (Cardinal) on Dec 04, 2002 at 18:52 UTC | |
by dws (Chancellor) on Dec 04, 2002 at 18:59 UTC | |
by Ovid (Cardinal) on Dec 04, 2002 at 19:11 UTC |