In this instance, I don't really care whether the methods do nothing or are wiped out. In the interest of nearly full disclosure, here's what I'm doing...

I've wrote a class for a particular thing, and there might be 30 or so attributes in this thing, and I want to validate some of these attributes according to certain rules and policies (some of the policies are more like warnings, as in "there might be a problem"), so I wrote validate_<attribute> methods for each thing I wanted to validate. I wrote this for my department, which has certain policies, and now I find I need to write the same sort of thing for another department.

Some of the validation rules are global, but some are just for my department. So I'd like to skip some of the attribute validations in the sub class for now, but leaving placeholders for future validation code seems like a good thing (whether subs with empty bodies or subs that do nothing). The "right" thing to do might be to write a base class with just the global rules, and subclass both modules from there, or maybe write just a Validation subclass, but in the interest of doing less work, I'm just using the first module as a super class for the second.

The actual things may have already been put into production before policies have been created, so the ability to create and manipulate objects with possibly "invalid" attributes is desirable, especially since validating things is not the only thing this module does.

Update: With only one subclass and still total control, there's still time for refactoring, so it might not be a bad idea to separate the global rules from the departmental ones in the near future, and work something out that way.


In reply to Re^4: Attempt to uninherit method by runrig
in thread Attempt to uninherit method by runrig

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.