I'd personally rather say "Make sure this object can handle any message I can send an Arcade." Since the Airport contains an Arcade, it will just delegate methods like colle­ct_qu­arter­s and play_­annoy­ing_d­ance_­music to the Arcade it contains.
Why should an Airport act as an Arcade?

As an example, let's pretend a mall has a skate park in it. I don't think that the mall should act as a skate park in any way--unless you're writing a Tony Hawk game. :^)

Going back to interfaces, the one thing I see them as being useful for in a language that supports MI is for specifying properties of a class (in the Perl 6 sense of the word). For example, in .NET any serializable class implements the ISerializable interface. (I've probably got some karmic justice coming soon for suggesting that an M$ design is good... ;^) )

Personally, I would standardize on a 'get_arcade' method for when you're handed something that isn't an Arcade:

$arcade=$arcade->get_arcade until $arcade->isa('Arcade');

=cut
--Brent Dax
There is no sig.


In reply to Re: Class::Interface -- isa() Considered Harmful by BrentDax
in thread Class::Interface -- isa() Considered Harmful by chromatic

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.