Difference between revisions of "Property attributes"
From Free Pascal wiki
Jump to navigationJump to searchPaul Ishenin (talk | contribs) |
Paul Ishenin (talk | contribs) |
||
Line 27: | Line 27: | ||
end; | end; | ||
</delphi> | </delphi> | ||
+ | |||
+ | == How to store additional info == | ||
+ | |||
+ | There was 2 suggestions about place for properties attributes: | ||
+ | |||
+ | #RTTI. Advantage - easy access from application. Disadvantage - bigger final executable. | ||
+ | #PPU. Advantage - info will not be added to executable. Disadvantage - more complicated way of accessing data. | ||
+ | |||
+ | As result of discussion PPU storage has been selected. |
Revision as of 10:31, 20 October 2007
Syntax Diagram
PropertyDeclaration ::= PROPERTY Identifier [PropertyInterface] [PropertySpecifiers] [Directives]
PropertySpecifiers ::= [ ... ] [ ... ] [ATTRIBUTES AttributesArray]
AttributesArray ::= '[' (AttributeDeclaration [, AttributeDeclaration]) ']'
AttributeDeclaration ::= '<string>':'<string>'
Declaration Examples
<delphi> TmenuItem = class(...) ... property Detachable: Boolean read FDetachable write SetDetachable attributes
['widgetsets:qt,gtk,win32', 'implementor:Vasya Pupkin', 'creation-date:01.01.2007'];
... end; </delphi>
<delphi> TxxxDatabase = class(...) ... property TransactionModel: TTransactionModel read FtransactionModel write
SetTransactionModel attributes ['engines:firebird,oracle,sybase-asa'];
... end; </delphi>
How to store additional info
There was 2 suggestions about place for properties attributes:
- RTTI. Advantage - easy access from application. Disadvantage - bigger final executable.
- PPU. Advantage - info will not be added to executable. Disadvantage - more complicated way of accessing data.
As result of discussion PPU storage has been selected.