[Lazarus] OOP basics - 2

Marco van de Voort marcov at stack.nl
Thu Apr 15 15:34:12 CEST 2010


On Thu, Apr 15, 2010 at 11:40:24AM +0200, Graeme Geldenhuys wrote:
> 
> It's not only a issue about managing the large files. If you dump all
> classes in a single large unit (or include files, it makes no
> difference), then you give up on all the class visibility rules. Now
> all classes can access all private field variables or methods of all
> other classes in the same unit. THIS is not always a good thing, and
> splitting those classes over multiple units, allows for visibility
> rules.

I've always thought that (and strict private) to be highly doubtful.

IMHO there is a bigger chance in making mistakes in micromanaging visibility
that you regret later, then making dangerous mistakes because private is
visible inside an unit.




More information about the Lazarus mailing list