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

Mattias Gärtner nc-gaertnma at netcologne.de
Tue Oct 20 01:14:35 CEST 2009


Zitat von Vinzent Höfler <JeLlyFish.software at gmx.net>:

> Florian Klaempfl <florian at freepascal.org>:
>
>> Marco van de Voort schrieb:
>> > In our previous episode, Florian Klaempfl said:
>> >>> This is exactly my point about sealed classes. When you design the
>> >>> product or class, you have NO way of know what will come in the
>> >>> future. So you need to stay flexible to change! Yet another OOP
>> >>> principal that "sealed" tries to prevent!
>> >> This might be true, but what's the difference with private etc.?
>> >
>> > Private is typically used in nearly every class, sealed in exceptional
>> > cases. At best.
>>
>> I meant regarding "flexibility". Declaring a member private makes things
>> also less flexible.
>
> The main difference is that "private" restricts visibility, whilst  
> "sealed" restricts extensibility. The former is usually a good  
> thing, the latter not.

True.
But as already mentioned:
It does not hurt.
Granted, the compiler became somewhat bigger and slower, in fact all  
pascal parsers became somewhat bigger and slower (fcl, codetools,  
highlighters, ...), a new modifier bites some existing code, the  
documentation becomes more complex, newbies have more to learn, it  
allows to create dead end code and all this has to be maintained.
That's all.
That's nothing.
It does not hurt.


Many a mickle makes a muckle.

Mattias




More information about the fpc-devel mailing list