[fpc-devel] class abstract, class sealed implementation. please review.

"Vinzent Höfler" JeLlyFish.software at gmx.net
Sat Oct 17 12:55:05 CEST 2009


Graeme Geldenhuys <graemeg.lists at gmail.com>:

> 2009/10/16 Alexander Klenin <klenin at gmail.com>:
> > "Class sealing allows extension of classes within a package, but
> > prevent clients from extending such classes outside of the package."
> > This might actually make some sense, see e.g. TBasicChartSeries class
> > in TAChart package.
> 
> As I said in my earlier reply. I don't see the point of sealed class.

Me neither. But there may be some use, still.

> Why would you want to limit the use of a class. It goes against the
> OOP principals. One developer cannot think of all possible uses for a
> class, so why limit other developers that could see other uses or
> extensions.

Quite true. But you don't need "sealed" for that. It is enough to "forget" to declare some methods as "virtual". I don't remember how often I tried to extend some class (like TThread), finally realizing that some required method can't be overriden...


Vinzent.
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the fpc-devel mailing list