As long as your co-workers are prepared to handle sophisticated approaches like this, there is nothing wrong with what you are doing. I have done the same in the past and been happy with the result.

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.


In reply to Re (tilly) 1: Whats wrong with symbol refs here? by tilly
in thread Whats wrong with symbol refs here? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.