On Tue, 2007-06-26 at 17:56 +0200, David Nečas (Yeti) wrote:
> The commonly listed reasons for nonsubclassable types are
> performance and security (in languages where final classes
> can have any effect on these) -- not encapsulation which is
> achieved by other means.

There are other reasons as well.  Some classes are not designed to be
subclassed and don't work well when subclassed.  (A C++ example would be
a class with a non-virtual destructor.)  The author of such a class can
always document it as being non-subclassable, but designers typically
prefer to pass enforcement of such constraints to the compiler by
declaring the class final.


_______________________________________________
gtk-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to