I'm not sure I understand you, but continuous runtime redefinition of a class seems evil--especially as it seems like you easily can do without, but I may be wrong.

I read "object interface methods" as get/set methods. If I'm right in that I still don't see why you can't use generic get/set methods instead, and give the attribute/property as name. Then you wouldn't need to redefine the class, just some settings in the object. That would be much preferable to me.

The calls to these objects are generated by user input

I see that as an argument for having generic methods instead.

The problem with AUTOLOAD and inheritance is no problem in this case.

It's seldom a problem for you, the author of it. Instead, it may become a hazzle for whomever that decides to subclass your class.

And with autoload, I can get easy error messages if somehow an object interface method is called that is not allowed.

Why would that be easier? You can just define a list with allowed attributes, and then check against that in the get/set methods. In autoload you much first check so that it indeed is a get/set method, otherwise die with a missing method error message. And then you much do the check I just mentioned anyway.

I can't stop thinking that I've completely misunderstood you, but I fail to make any other plausable interpretation.

ihb

In reply to Re: Re: Re: Re: is autoload bad style? by Anonymous Monk
in thread is autoload bad style? by racer_x

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.