How about not thinking of it in terms of "class data" but as the data that belongs to a singleton object, the "class" or "factory"? So the only access is via class methods, and no method returns back the raw entire class data. If a subclass wants to extend or manage this data in a distinct way, it can use SUPER calls to get to the data.

This is as opposed to "class instance" data, the data that belongs to each singleton class object. For example, if a Dog inherits from Animal, class data for Animal would also be shared by Dog. But class instance data would be distinct individually for Dogs vs Animals, in which case the class methods would be inherited for behavior but not actual data access.

So, actually, I'm puzzled. Did you mean class data, or class instance data?

-- Randal L. Schwartz, Perl hacker


In reply to Re: opinions on the best way to inherit class data by merlyn
in thread opinions on the best way to inherit class data by d_i_r_t_y

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.