No subject

Pedro Duque Vieira pedro.duquevieira at
Mon Sep 2 13:10:19 PDT 2013

> > On Mon, 02 Sep 2013 18:10:17 +0200, Christian Schudt
> > <christian.schudt at> wrote:
> >
> >> I agree with that and I also recommend to have a look at "Item 17:
> >> Design and document for inheritance or else prohibit it" from
> >> Effective Java.
> >>
> >>
> >>
> >>
> >> It explains the burden and dangers of non-final design quite well.
> >
> > +1
> >
> >
> -1
> This applies only to the perfect (final) framework.
> In other words for a framework without bugs and a framework, where all
> possible usecases are considered by its author.
> I agree that there are dangers, when overwriting methods. But in my
> experience they rarely matter. Once created methods rarely change in a
> way that affects subclasses. And for major releases of the framework you
> have to test your application anyway.
> If you develop a framework, where methods have complex interdependencies
> you should step back and write smaller, more manageable methods.
> There are always legitimate reasons to overwrite methods. e.G.: To work
> around a bug in the framework. To trigger events, when a certain method
> has been called, to write debug info in a logfile,.... And no I don't
> want to roll out my own fork of jdk to my customers to do this....

-1 as well.

One of the major points of Java is that it is an object oriented language.
By making things final you kill one of the major O.O. benefits, that is
subclassing. You can do composition but it's not the same thing as you can
not pass in the object to methods that accept the composed class.

Though, I also agree that it should be difficult to create a framework
where all use cases of subclassing a class are accounted for, especially
when you have to preserve backwards compatibility.

Best regards,

Pedro Duque Vieira

More information about the openjfx-dev mailing list