in reply to Whats wrong with symbol refs here?
To answer the question asked elsewhere about AUTOLOAD, there are several advantages. First of all every time you need to change the symbol table you throw away the method cache. If you think most of your methods are going to get called eventually then it makes sense to only pay that once.
That one is relatively unimportant though. The big one is that you now are not forced to put all of your dynamic logic in one place. With AUTOLOAD you need to put all of your dynamic logic in the first AUTOLOAD. And if you have a subclass which should work just like its parent but with a minor tweak...you need to duplicate logic. But with this code the dynamic bit only affects what it needs to at the level it wants to and can override and be overridden in a fine-grained manner. This gives quite a bit more design flexibility than AUTOLOAD offers.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re (tilly) 1: Whats wrong with symbol refs here?
by Anonymous Monk on Feb 05, 2002 at 21:24 UTC | |
by dragonchild (Archbishop) on Feb 11, 2002 at 13:54 UTC |