On Sun, Oct 06, 2002 at 06:17:37PM -0400, Daniel B. Boorstein wrote:
> I think there may be some confusion here. In java, there's no special syntax 
> to declare a method an optional part of the interface. All concrete classes 
> that implement the Collection interface still must define full-bodied 
> C<add(Object element)> methods. It just so happens that by convention some 
> classes simply throw an UnsupportedOperationException, perhaps like so:

AHHHH!  No wonder I couldn't find any syntax for it!  Thanks for clearing
that up.

Still, the objections still hold, though now it's a stylistic objection
rather than syntactic.  It's disturbing that they'd put these optional
methods into the core Java API, thereby encouraging their use ("Sun did it,
so I can to!").  Cannonizing the idea weakens the whole concept of an
interface and contract.

It really ought to be one of those "sure you can do this, but please don't"
things.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
You see, in this world there's two kinds of people.  Those with loaded
guns, and those who dig.  Dig.
                -- Blondie, "The Good, The Bad And The Ugly"

Reply via email to