[Lazarus] TImage - Getting image properties in 'canvas space'

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Apr 19 20:51:58 CEST 2012


Martin Schreiber schrieb:

> May I repeat the idea of "friend units"?
> While designing a complex framework like Lazarus, fpGUI or MSEgui there 
> constantly is the need to access low level functions from other classes. Now 
> one has the options to write the whole framework in a single unit (ex. 
> db.pas), to make most of the class elements public or to use local alias type 
> definitions.

This also requires to modify the existing classes. If every user can do 
that, encapsulation *really* has gone away :-(


> The introduction of "friend units" would be a simple solution. In "friend 
> units" the protected class members would be visible. So if you build a 
> framework and you know what you do, list the base units of the framework as 
> friends of higher level units of the same framework.

See "framework" as an special case of what a user wants to achieve. 
Where will you draw a boundary between *acceptable* and *unwanted* 
breaking of visibility, by using friends, class helpers or any other means?

DoDi





More information about the Lazarus mailing list