The example you cited of changing functionality (123,456 => 12,3456)
is a re-specification of the design or contract and probably shouldn't
be done, or at very least, would require a very clear notation in the
Yes, but shouldn't you have tests checking that your superclass didn't
change its specification? Shouldn't that be very important tests?
It would also logically lead to a maze of dark twisty tests, where every
module would start testing that substr counted from 0 not 1 and that *
really knew how to multipy two numbers.
No, because your module isn't providing substr or multiplication
functionality. It isn't subclassing the functionality of the Perl
runtime environment. But if you have a class that's subclassing a class
that provides number formatting, then your class is providing number
formatting. That that happens through inheritance isn't something the
users need to know (encapsulating of the implementation).
It's the same if you buy a Ford. You'd expect that Ford checks that the
tires stay on the wheels when going 100km/h, and don't assume that they
delegate that to Goodyear (or whatever brand they use). Goodyear does
its test, but Ford should do as well.
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||