[fpc-devel] Re: Class field reordering

Graeme Geldenhuys graemeg.lists at gmail.com
Mon Jul 23 19:16:12 CEST 2012


Hi,

On 23 July 2012 15:31, Ian Macintosh <ian.macintosh at igmac.co.uk> wrote:
> the design concept to me.  What Graeme is saying is 100% correct, but also
> the wrong way to design imho.

I don't see it like that. I have developed thousands of classes, and
huge frameworks. I often find a new case where I need access to
something I haven't thought of before. This is exactly the case here.
The FPC team is basing lots of design work on Delphi code, but FPC is
also used quite differently to Delphi. So there is no way they could
have though of all possible use-cases for each class and every
property or field in those classes.


> Public is simple, it's part of the contract you have in the class.  It is
> what you should rely on not to change, and I always want to make as much as
> possible public.

Visibility rules are a "contract". It is easier to add to that
contract (make private things protected), that is is to make Public
things protected. The latter case will break a lot more code.

Saying that, changes must still be justified to make sure that the OOP
design stays good and maintainable.

-- 
Regards,
  - Graeme -


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



More information about the fpc-devel mailing list