Thanks for reminding my of Knuth's sage advice.

I think what I'm getting at is that using Order in X is misguided. When we say that doSomething() operates on an Order object, we are really saying that it operates on an object that behaves like an Order. It could be an instance of Order or an instance of a sub-class or just a mocked-up object that implements enough of the methods of an Order to make it look like an Order to doSomething().

There may be no harm in including it, but on the other hand I can't think of a compelling reason to do so. If a real instance of Order will get passed to doSomething, then the caller can be responsible for ensuring that the Order name space is loaded.

Perhaps I forgot to mention that this particular application consists of 800+ modules, and all of that unnecessary module loading is a big drag on unit testing.


In reply to Re^2: general rule for using use by perl5ever
in thread general rule for using use by perl5ever

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.