develooper Front page | perl.perl6.language | Postings from August 2001

Re: Come and get me, Schwern

Thread Previous
From:
Bart Lateur
Date:
August 30, 2001 03:53
Subject:
Re: Come and get me, Schwern
Message ID:
8c6sot80qcf54ru6g12j397j9744rtir4k@4ax.com
On Wed, 29 Aug 2001 16:26:59 -0500, David L. Nicol wrote:

>Bill J. Programmer publishes a class foo that is guaranteed to correctly
>blarg the frobniz, someone subclasses it and breaks the blarg function,
>that simply will not do!
>
>With a "final" it is no longer possible for the new class to identify
>itself as a foo.

It's not a foo. It's instance of a *subclass* of foo. If it can't be
different than foo, then you might just as well toss out the idea of
subclassing altogether.

Look at the "lame duck" example on this page:
<http://www.cs.mdx.ac.uk/harold/srf/javaspae.html>. So you say a duck
has two legs. That's fine as a default. But a lame duck, with one leg
missing, only has one leg. So if you make the number of legs (or feet)
of a duck "final", then lame ducks can't be ducks. Or they can be ducks,
but then they can't have but one leg.

-- 
	Bart.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About