[Lazarus] Is it meaningful or possible to change the visibility or the properties and events in a form or datamodule, ie make the private or protected?

Sven Barth pascaldragon at googlemail.com
Sat Mar 24 19:58:18 CET 2012


On 24.03.2012 18:54, Graeme Geldenhuys wrote:
> On 23 March 2012 15:55, Frank Church  wrote:
>> properly sunk in. It makes me wonder whether I've got my whole
>> approach to object orientation and encapsulation with Object Pascal
>> wrong or misconceived as a result of that. I guess it is more obvious
>> if you start using Lazarus of FPC more on the non visual areas.
>
>
> Indeed. Using tools like Lazarus IDE and Delphi IDE to build OOP apps
> is the worst possible way of doing it. Simply because those two IDE's
> rely on streaming via RTTI, which is hugely limited to Published
> properties only - thus everything ends up being publicly visible. Yes
> the new Delphi now has improved RTTI, but they haven't change the
> "everything must have visibility of Published" to work.

That's might be mostly because one of the important aspects of Delphi is 
backwards compatibility (yes, I know that there was the switch from 
AnsiString to Unicodestring, but there is a saying in Germany: 
exceptions confirm the rule ;) ). The aspect that it costs time (aka 
money) without a "real" benefit (while I take your critic serious the 
guys at Embarcadero might just laugh at you) might also be an important one.
In theory one should be able to implement a GUI framework based on the 
concept of the extended RTTI. With quite some work it might even be 
possible to switch something like the LCL to such an approach (though 
then the famous Delphi compatibility comes in ^^) once FPC has support 
for the extended RTTI (where noone is working at currently).

Regards,
Sven




More information about the Lazarus mailing list