I think a more appropriate definition would state that you can access a property or method only if it is protected or public. Therefore, it is impossible to override any property or method that you cannot access.
Yes, but. A property that uses private setter and getter methods can't be overriden, but it can be accessed, because the property itself is public. And a proeprty can't be declared dynamic, it's setter and getter methods can, but have to be declared protected.
So, one way to look at it is that a public property makes private methods visible in some aspects and in some not.
Yes it is dangerous until we gain a good understanding of how the compiler actually does its "late binding" magic.
True.
I don't like static overriding at all. That's what I think is dangerous.
My problem came when I wanted to override the "Position" and "Size" properties of TStream. Theese properties uses private setter and getter methods. Theese methods uses the protected virtual method "Seek" to perform its actions.
In my case, writing a transparent stream class for WMA decoder in BASS, I didn't want to use that technique. I wanted to override the Position and Size properties.
A class I have written (before I knew about BASS) that handles the playing of sounds takes any stream and treats it's data as RAW PCM data. For each read it checkes the size of the stream and the position to see if it has reached the end of the stream (and by "stream" I mean any TStream descendant).
Whenever I ask the stream for it's size, it is beeing seeked to the very end and the position is returned, and then back again. BASS does not like settings positions in a WMA stream like that all the time, it takes too long. BASS provides me with methods for getting positions and sizes of BASS-streams, so it would be wise to use those.
I have now been forced to do a rather ugly workaround for this to work, and all because properties can't be overriden.
Or maybe I should say it is because the TStream class in delphi is poorly written, considering that properties can't be overriden.
Anyway, thanks for your answer!