Please could someone explain me what's the difference between public and published class members in Delphi?
I tried to look at Delphi help and I understand that these members have the same visibility, but I don't understand very well how they differ and when should I use published members instead of public ones.
Thanks a lot.
The compiler generates RTTI (Run-Time Type Information) metadata for published members, but not for public members (by default). The main effect of this is that the published properties of an object will appear in the Object Inspector at design time.
I do not know if you are writing components, but if you do, you probably know that properties and events are normally published, so that they can be set using the Object Inspector.
public
property MyProperty: integer read FMyProperty write FMyProperty
MyProperty
will not be visible in the Object Inspector.
published
property MyProperty: integer read FMyProperty write FMyProperty
MyProperty
will be visible in the Object Inspector.