[fpc-devel] Class field reordering

Graeme Geldenhuys graemeg.lists at gmail.com
Sun Jul 15 19:55:43 CEST 2012


Hi,

On 15 July 2012 18:21, Michael Van Canneyt <michael at freepascal.org> wrote:
> For example:
> TParam.FBound
> Is directly accessible through TParam.Bound, so why on earth would you need
> to have it protected ??


I haven't worked through his list myself, but I had a quick look at
one property I had issues with ages ago.... ComponentState is a
read-only property and FComponentState is private. Originally I
couldn't set csLoading because of the private field variable, but
luckily the FPC team was accommodating by adding a protected virtual
Loading() method so that I could set/unset the property. They could
have just made ComponentState read-write too, but didn't for some
reason. Now Delphi and Lazarus never needed this for some reason due
to TWriter/TReader being in the same unit (or something like that),
but fpGUI doesn't because its loading of forms work very differently.

Anyway, I'm not saying I agree with his whole list... as your example
shows, TParam.Bound is a public read-write property already... my
example of ComponentState wasn't, but I only needed csLoading. Maybe
Martin needs to set some of the other states too and no related
methods exist?

Anyway, as you said, maybe justifying some of those items in his list
could hep explain the problems more - and suitable solutions could be
found.


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net



More information about the fpc-devel mailing list